python学习之for语句
1.range数字范围
for i in range(5): print (i)
结果显示: 0 1 2 3 4
2.列表显示
for i in ['100','200','300','100']: print ("current num:",i)
结果显示: current num: 100 current num: 200 current num: 300 current num: 100
3.for and if
for i in range(5): if i<=3: print("loop:", i)