sh_06_break
1 i = 0 2 3 while i < 10: 4 5 # break 某一条件满足时,退出循环,不再执行后续重复的代码 6 # i == 3 7 if i == 3: 8 break 9 10 print(i) 11 12 i += 1 13 14 print("over")
sh_06_break
1 i = 0 2 3 while i < 10: 4 5 # break 某一条件满足时,退出循环,不再执行后续重复的代码 6 # i == 3 7 if i == 3: 8 break 9 10 print(i) 11 12 i += 1 13 14 print("over")