use special characters in string python code example
Example 1: python tab character
Escape Sequence Meaning
\t Tab
\\ Inserts a back slash (\)
\' Inserts a single quote (')
\" Inserts a double quote (")
\n Inserts a ASCII Linefeed (a new line)
Example 2: python print show special characters
a = "Hello\tWorld\nHello World"
print(repr(a))
# 'Hello\tWorld\nHello World'
Example 3: python escape characters
\' Single Quote
\\ Backslash
newline = '\n'