看不懂简明python教程_简明python教程
linux查詢(xún)python版本:python -V
linux進(jìn)入python:python
退出python:CTRL+D
使用源文件:helloworld.py
運(yùn)行這個(gè)程序:python helloworld.py
目錄添加到PATH變量中:PATH=$PATH:/home/swaroop/mydir完成。其中“/home/swaroop/mydir ”是我想要添加到PATH變量中的目錄。
python中字符串使用:
(1)使用單引號(hào)(‘)
‘Quote me on this’
(2)使用雙引號(hào)(“)
雙引號(hào)中的字符串與單引號(hào)中的字符串的使用是完全相同的。
"What‘s your name?"
(3)使用三引號(hào)(”’或者“‘”’)
利用三引號(hào),可以指示一個(gè)多行的字符串。你可以在三引號(hào)中自由的使用單引號(hào)和雙引號(hào)。
‘‘‘This is a multi-line string.This is the first line.This is the second line."waht‘s your name?,"I asked.He said"Bond,James Bond. "‘‘‘
(4)轉(zhuǎn)義符
在字符串中輸出’ " \,使用\‘ \" \\
注意:“This is the first sentence.\
This is the second sentence.”=====>等價(jià)于“This is the first sentence.This is the second sentence.”
總結(jié)
以上是生活随笔為你收集整理的看不懂简明python教程_简明python教程的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 22计算机408考研—数据结构—线性表、
- 下一篇: Python 3 学习——函数扩展and