Python: String Escape Sequence
What is Escape Sequence
A String Escape Sequence is a character sequence starting with backslash, inside String, to represent a character.
For example, \n means linebreak.
# \n means linebreak x = "A\nB" print(x) # A # B
List of Escape Sequence
\'- APOSTROPHE
\"- Double quote
\\- Backslash
\a- ASCII Bell.
\b- ASCII Backspace
\f- ASCII Formfeed
\n- ASCII Linefeed
\r- ASCII Carriage Return
\t- ASCII Horizontal Tab
\ooo- ASCII Character ID in 3 octal digits.
\xhh- ASCII Character ID in 2 Hexadecimal digits.
\uxxxx- Character with Unicode Codepoint in 4 Hexadecimal digits. 〔see Python: Unicode Escape Sequence〕
\Uxxxxxxxx- Character with Unicode Codepoint in 6 Hexadecimal digits. 〔see Python: Unicode Escape Sequence〕
\v- ASCII Vertical Tab
\N{name}- Unicode character named name. 〔see Unicode: Character Set, Encoding, UTF-8, Codepoint〕
Python, String
- Python: Quote String
- Python: Triple Quote String
- Python: String Escape Sequence
- Python: Unicode Escape Sequence
- Python: String Prefix Character (u f r b)
- Python: Raw String (r-prefix)
- Python: f-String (Format, Template)
- Python: Print
- Python: Join String
- Python: Format String (Convert to String)
- Python: String Operations and Methods
- Python: Search Substring
- Python: Split String
- Python: String, Check Case, Char Class
- Python: Letter Case Conversion
- Python: Unicode 🐍
- Python 2: Unicode Tutorial