首页 > 代码库 > python day1

python day1

1.变量

nums_of_alex

不允许数字开头,不允许特殊字符。可以下划线开头

以下关键字不能声明为变量名
[‘and‘, ‘as‘, ‘assert‘, ‘break‘, ‘class‘, ‘continue‘, ‘def‘, ‘del‘, ‘elif‘, ‘else‘, ‘except‘, ‘exec‘, ‘finally‘, ‘for‘, ‘from‘, ‘global‘, ‘if‘, ‘import‘, ‘in‘, ‘is‘, ‘lambda‘, ‘not‘, ‘or‘, ‘pass‘, ‘print‘, ‘raise‘, ‘return‘, ‘try‘, ‘while‘, ‘with‘, ‘yield‘]

a=3

id(a) 看内存地址

 

2.  if  elif else 判断语句

强制缩进

3.

‘’‘

’‘’

#隐藏

4. 选中+tab键 整理代码

5. while True :

count = 0 
while count < 3 :

  count +=1

判断 

if :

elif :

else:

 

for i in range(1,100,10)

 

python day1