# pass/continue/break语句
# pass占位语句,什么都不会做
for i in range(10):
pass
>>>
# continue跳过当前循环,继续下一次循环
for i in range(4):
if i == 1:
continue
print(i)
>>> 0
>>> 2
>>> 3
# break跳出当前循环
for i in range(4):
if i == 1:
break
print(i)
>>>0
python初入江湖:pass/continue/break语句
最新推荐文章于 2022-09-12 20:36:40 发布