a=1 while True: print (a) a+=1 if a>=10: break for a in range(10): if a==5: break print (a) for a in range(10): if a==5: continue print (a)
C:\Users\pcdog\AppData\Local\Programs\Python\Python35\python.exe C:/Users/pcdog/PycharmProjects/untitled/break.py
1
2
3
4
5
6
7
8
9
Process finished with exit code 0
本文出自 “于昊(Pcdog)的博客” 博客,请务必保留此出处http://433266.blog.51cto.com/423266/1740895
原文:http://433266.blog.51cto.com/423266/1740895