print用法:
输出数字:print(4)
输出字符串类:print(" ");print(' ');print('I\'m m');
输出混合类:print(' '+' '); print(' '+str(4))
输出运算类:print(int('1')+2) (根据数字类型改变);print(1+2)
输出自变量
print('自变量')
a,b,c=1,2,4*2
d=c**2
print(a,b,c,d)
while循环
print('while 循环')
a=1
while a<10:
print(a)
a=a+1
print('ctrl+c:停止程序')
for循环
print('for 循环') #迭代器的作用
example_list=[122,3,4,54,6,8,8,9,0]
for i in example_list:
print(i)
print('inner of for') #运行在for循环内
print('out of for') #运行在for循环之外
for a in range(1,10,2): #不是1到10,而是1到9,2是步长
print(a)
if判断
print('if 语句')
x=2
y=2
z=3
if x<y<z:
print('x is less than y,and y is less than z')
if x<=y:
print('x is less or equal to y')