練習(xí)10--那是什么
- 練習(xí)程序
- 課后記錄
練習(xí)程序
# -*- coding:utf-8 -*-
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
"""
print tabby_cat
print persian_cat
print backslash_cat
print fat_cat
運(yùn)行結(jié)果
PS F:\python大師\習(xí)題> python .\ex10.py
I'm tabbed in.
I'm split
on a line.
I'm \ a \ cat.
I'll do a list:
* Cat food
* Fishies
* Catnip
* Grass
課后記錄
\(在行尾時(shí)) 續(xù)行符
\\ 反斜杠符號(hào)
\' 單引號(hào)
\" 雙引號(hào)
\a 響鈴
\b 退格(Backspace)
\e 轉(zhuǎn)義
\000 空
\n 換行
\v 縱向制表符
\t 橫向制表符
\r 回車
\f 換頁
\oyy 八進(jìn)制數(shù)yy代表的字符妙蔗,例如:\o12代表換行
\xyy 十進(jìn)制數(shù)yy代表的字符印衔,例如:\x0a代表換行
\other 其它的字符以普通格式輸出
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)
\r Carriage Return (CR)
\t Horizontal Tab (TAB)
\uxxxx Character with 16-bit hex value xxxx (u'' string only)
\Uxxxxxxxx Character with 32-bit hex value xxxxxxxx (u'' string only)
\v ASCII vertical tab (VT)
\ooo Character with octal value ooo
\xhh Character with hex value hh