Python string
Single and double quotation marks are fairly effective
>>> Wu = ' wuang '
>>> Wu
' Wuang '
>>> Wu = "Wuang"
>>> Wu
' Wuang '
>>> Wu = ' wuang\ '
>>> Wu
"Wuang ' s"
>>> Wu = "Wuang S"
>>> Wu
"Wuang ' s"
Escape symbols
\ nthe line break
>>> Wu = ' wuang\nnihao! '
>>> Print Wu
Wuang
Nihao!
\ t tab
>>> Wu = ' wuang\tnihao! '
>>> Print Wu
Wuangnihao!
\v Vertical Tab
>>> Wu = ' wuang\vnihao! '
>>> Print Wu
Wuang
Nihao!
Do not escape
>>> Wu = R ' wuang\nnihao! '
>>> Print Wu
Wuang\nnihao!
Or
>>> Wu = ' wuang\\nnihao! '
>>> Print Wu
Wuang\nnihao!
Sanchong quotation marks
>>> Wu = "" "Wuang
... Nihao "" "
>>> Wu
' Wuang\nnihao '
>>> Print Wu
Wuang
Nihao
>>> Wu = "Wuang"
... Nihao "
>>> Wu
' Wuang\nnihao '
>>> Print Wu
Wuang
Nihao
This article is from the "Don't Ang" blog, please be sure to keep this source http://wuang.blog.51cto.com/9559762/1605938
Python fifth day (string one)