python中的continue和break
1、comntinue只会跳出当次循环 代码:
count
=0
while count
<100:
print("loop",count
)
if count
==5:
continue
count
+=1
执行结果 2、break是完全结束一个循环体 代码
count
=0
while count
<100:
print("loop",count
)
if count
==5:
break
count
+=1
运行截图
在调试代码的过程中,发现python有着严格的格式规定,逻辑一定要严密。多出的空格,可能会有不同的输出结果。