一起学python-语法

1、print 输出

2、定义变量:就是给变量赋一个值 name ='haha' print (name)

3、注释代码:# 注释快捷键:Ctrl +/

4、单双引号:

如果字符串里面有单引号,外面就用双引号;其他单双都行;

例如:Let's go,you are so "beautiful" 可以这样做:''' Let's go,you are so "beautiful" '''

三个单引号还可以注释:例如, ''' hdhfjdhfjdhfjdhfjdhfjdhfjdhfjd '''

5.input ("请输入你的名字")

6.符号:> < >= <= == !=

7.字符类型转换,string 转 int

score = input ("请输入你的成绩:")
score = int(score)

猜你喜欢

转载自www.cnblogs.com/sheilali1234/p/10624932.html