tabby_cat="\tI'm tabbed in."persian_cat="I'm split\non a line."backslash_cat="I'm \\ a \\ cat."fat_cat="""
I'll do a list:
\t* Cat food
\t* Fishies
\t* Catnip\n\t* Grass
"""printtabby_catprintpersian_catprintfat_cat
这里,\t是输出Tab。运行结果:
小结
这节重点介绍了Escape Sequences,常用的可以见下表:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
ESCAPE | WHAT IT DOES(-)
\\ | Backslash(\)
\' | Single-quote(')
\a | ASCII bell(BEL)
\b | ASCII formfeed(FF)
\n | ASCII linefeed((LF)
\N{name} | Character named name in the Unicode database (Unicode only)
\r | Carriage Return(CR)
\t | Horizontal Tab(TAB)
\uxxxx | Charater with 16-bit hex value xxxx (Unicode only)
\Uxxxxxxxx | Character with 32-bit hex value xxxxxxxx (Unicode only)
\v | ASCII vertical tab(VT)
\ooo | Character with octal value ooo
\xhh | Character with hex value hh