1 嵌套循环 2 for i in range(10): 3 if i > 5: 4 #countinue 跳出本次循环 5 #break 跳出这一层整个循环 6 #continue 7 break 8 print(i) 9 ----------------------------------------------10 #输出:11 012 113 214 315 416 517 ------------------------------------------------------------------------------18 for i in range(10):19 if i < 5:20 #countinue 跳出本次循环21 #break 跳出这一层的整个循环22 continue23 #break24 print(i)25 ----------------------------------------------26 527 628 729 830 931 ----------------------------------------------------32 for j in range(5):33 for i in range(10):34 if i < 5:35 #countinue 跳出本次循环36 #break 跳出这一层的整个循环37 continue38 #break39 if j>3:40 break41 print(i)