Python Escape Sequence Characters
\\ - Backslash
print("This is a backslash: \\\\") # Output: This is a backslash: \\
\' - Single quote
print(\'It\\\'s Python!\') # Output: It\'s Python!
\" - Double quote
print("She said: \\\"Hi!\\\"") # Output: She said: \"Hi!\"
\n - New line
print("Line1\\nLine2") # Output:\nLine1\nLine2
\t - Horizontal tab
print("Hello\\tWorld") # Output: Hello World
\r - Carriage return
print("12345\\rabc") # Output: abc45
\b - Backspace
print("abc\\bdef") # Output: abdef
\f - Form feed
print("abc\\fdef") # Output may vary, rarely used
\a - Bell (alert)
print("\\a") # May produce a beep sound
Python Escape Sequence Characters
\v - Vertical tab
print("abc\\vdef") # Output may vary, rarely used
\ooo - Octal value (e.g., \141 for 'a')
print("\\141") # Output: a
\xhh - Hex value (e.g., \x61 for 'a')
print("\\x61") # Output: a