Example
Prompt
Demonstrate Python escape character.
Output: complete Python program
main.py
txt = "We are the so-called \"Vikings\" from the north."
Escape Characters
Besides that one, Python understands these other escape characters:
Escape characters reference table
main.py
# Escape Characters in Python
# ==================================================
# Code Result Description
# \' Single Quote Try it »
# \\ Backslash Try it »
# \n New Line Try it »
# \r Carriage Return Try it »
# \t Tab Try it »
# \b Backspace Try it »
# \f Form Feed
# \ooo Octal value Try it »
# \xhh Hex value Try it »