Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the Python string escape characters

Shulou Source: shulou.com Published: 2022-06-02 02:59:12 10月03日 Update

This article will explain in detail what Python string escape characters are, and the editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

There are many python string escape characters. I found that the information on the Internet is not very complete. Here I have carefully sorted out all the python string escape characters, as follows:

\ 0 NUL null character ascii value 0

\ 1 SOH title start ascii value 1

\ 2 STX body start ascii value 2

\ 3 ETX body end ascii value 3

\ 4 EOT end of transmission ascii value 4

\ 5 ENQ request ascii value 5

\ 6 ACK receives notification ascii value 6

\ 7 BEL ring ascii value 7

\ a BEL ring ascii value 7

\ b BS backspace ascii value 8

\ t HT horizontal tab ascii value 9

\ nThe NL newline key ascii value is 10

\ v VT vertical tab ascii value 11

\ F FF feed key ascii value 12

\ r CR enter key ascii value 13

\ ">\ 'single quotation mark ascii value 39

\\ backslash ascii value 92

Tip: bold escape characters are very common, please remember, others are rarely used, you can check here when needed.

Note: adding r before the string cancels the escape representation, for example:

"\ t" is represented as string data-a tab with an ascii value of 9

R "\ t" is expressed as string data--\ t, that is, the symbol\ and the letter t itself.

"\ 1" is represented as string data-- SOH, with an ascii value of 1

R "\ 1" is represented as string data--\ 1, that is, the symbol\ and the number 1 itself. In addition, it is used to represent grouping 1 in regular expressions.

This is the end of this article on "what are the Python string escape characters?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Characters strings escape data tabs articles tabs content bells more text symbols good practical middle use enter keys letters commonly used quotation marks numbers Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Docker Apple MariaDB Huawei