标签:
1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 # @Time : 2016/10/2 15:47 4 # @Author : Derby 5 # @File : whileloop.py 6 7 count=0 8 while True: 9 count += 1 10 if count >50 and count<60 : 11 continue 12 print("你是风儿我是沙,缠缠绵绵到天涯",count ) 13 ‘‘‘ 14 else: 15 print ("This is a diedloop?",count) 16 count += 1 17 ‘‘‘ 18 if count==100: 19 print("Haha,This is good loop!") 20 break
测试另外代码查看方式
方式一:
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2016/10/2 15:47 # @Author : Derby # @File : whileloop.py count=0 while True: count += 1 if count >50 and count<60 : continue print("你是风儿我是沙,缠缠绵绵到天涯",count ) ‘‘‘ else: print ("This is a diedloop?",count) count += 1 ‘‘‘ if count==100: print("Haha,This is good loop!") break
标签:
原文地址:http://www.cnblogs.com/derby/p/5928932.html