python-for 循环
结构:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 for i in range(10): 2 print(i)
每隔1个数打印一次(插值):
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 for i in range(0,10,2) 2 print(i)
for循环里面嵌套一个for循环:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 for i in range(10): 2 print("---",i) 3 for j in range(10) 4 print(j) 5 if j > 5: 6 break
结构:
1 for i in range(10): 2 print(i)
每隔1个数打印一次(插值):
1 for i in range(0,10,2) 2 print(i)
for循环里面嵌套一个for循环:
1 for i in range(10): 2 print("---",i) 3 for j in range(10) 4 print(j) 5 if j > 5: 6 break