Subscribe Contact

Home  »  Reference Materials



Escape Sequences

Escape
Sequence
Description Code Output
\\ Prints a backslash character.
print("\\")
\
\' Prints a single quote mark.
print("\'")
'
\" Prints a double quote mark.
print("\"")
"
\b Backspace - removes the previous character in the string.
print("Test" + "\b" + " String")
Tes String
\f Formfeed (FF)
print("Test\fString")
Test
       String
\n Linefeed (LF)
print("Test\nString")
Test
String
\N{name} Prints a character from the Unicode Character Database. You can find an index of the available emoji characters at here.
print(u"\N{Grinning Face}")

😀

\t Horizontal tab (TAB). Inserts a tab at the point of the \t sequence.
print("ABCD\tEFGHZ")
ABCD     EFGH


«  Previous : Reference : Dictionary Methods
Next : Reference : File Access Modes  »




© 2023 John Gordon
Cascade Street Publishing, LLC