欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Python学习笔记(3)Python中的转义字符

程序员文章站 2022-11-27 12:59:22
escape what it does. 含义 \\ backslash () 反斜杠 \' single-quote (') 单引号 \" double-q...
escape what it does. 含义
\\ backslash () 反斜杠
\' single-quote (') 单引号
\" double-quote (") 双引号
\a ascii bell (bel) 响铃符
\b ascii backspace (bs) 退格符
\f ascii formfeed (ff) 进纸符
\n ascii linefeed (lf) 换行符
\n{name} character named name in the unicode database (unicode only) unicode中的字符名;name就是它的名字
\r ascii carriage return (cr) 回车符
\t ascii horizontal tab (tab) 水平制表符
\uxxxx character with 16-bit hex value xxxx (unicode only) 值为16位十六进制xxxx的字符
\uxxxxxxxx character with 32-bit hex value xxxxxxxx (unicode only) 值为32位十六进制xxxx的字符
\v ascii vertical tab (vt) 垂直制表符
\ooo character with octal value ooo 值为八进制ooo的字符
\xhh character with hex value hh 值为十六进制数hh的字符