python for 跳出循环

(99条消息) Python中跳出循环的两种方法_python跳出循环_在线码BUG的博客-CSDN博客

# 结束本次循环,继续下次循环
for i in range(1,10):
    if i==3:
        continue
    else:
        print('循环了',i,'')

# 结束for循环
for i in range(1,10):
    if i==3:
        break
    else:
        print('循环了',i,'')

 

posted @ 2023-07-25 11:15  你说夕阳很美  阅读(65)  评论(0)    收藏  举报