看不懂简明python教程_简明python教程
linux查詢python版本:python -V
linux進入python:python
退出python:CTRL+D
使用源文件:helloworld.py
運行這個程序:python helloworld.py
目錄添加到PATH變量中:PATH=$PATH:/home/swaroop/mydir完成。其中“/home/swaroop/mydir ”是我想要添加到PATH變量中的目錄。
python中字符串使用:
(1)使用單引號(‘)
‘Quote me on this’
(2)使用雙引號(“)
雙引號中的字符串與單引號中的字符串的使用是完全相同的。
"What‘s your name?"
(3)使用三引號(”’或者“‘”’)
利用三引號,可以指示一個多行的字符串。你可以在三引號中自由的使用單引號和雙引號。
‘‘‘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)轉義符
在字符串中輸出’ " \,使用\‘ \" \\
注意:“This is the first sentence.\
This is the second sentence.”=====>等價于“This is the first sentence.This is the second sentence.”
總結
以上是生活随笔為你收集整理的看不懂简明python教程_简明python教程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 22计算机408考研—数据结构—线性表、
- 下一篇: 初识Jedis