糖尿病康复,内容丰富有趣,生活中的好帮手!
糖尿病康复 > 看不懂简明python教程_简明python教程

看不懂简明python教程_简明python教程

时间:2023-08-09 03:50:56

相关推荐

看不懂简明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教程》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。