data types table python' string escapes escape meaning \newline escape ( ignorethe newline \backslash (\\single quote ('\double quote ("\ ascii bell (bel\ ascii backspace (bs\ ascii formfeed (ff\ ascii linefeed (lf\ {nameunicode character with the given name \ooo character with the given octal value \ ascii carriage return (cr\ ascii tab (tab\uhhhh unicode character with the given -bit hexadecimal value \uhhhhhhhh unicode character with the given -bit hexadecimal value \ ascii vertical tab (vt\xhh character with the given -bit hexadecimal value if we want to use quotes inside normal quoted string we can do so without formality if they are different from the delimiting quotesotherwisewe must escape thema "single 'quotesare fine\"doubles\must be escaped 'single \'quotes\must be escaped"doublesare fine python uses newline as its statement terminatorexcept inside parentheses (())square brackets ([])braces ({})or triple quoted strings newlines can be used without formality in triple quoted stringsand we can include newlines in any string literal using the \ escape sequence all of python' escape sequences are shown in table in some situations--for examplewhen writing regular expressions--we need to create strings with lots of literal backslashes (regular expressions are the subject of this can be inconvenient since each one must be escapedimport re phone re compile("^((?:[(]\\ +[)])?\\ *\\ +(?:-\\ +)?)$"