1 #!/usr/bin/env python2 #-*-coding:utf-8-*-3 #@Time: 2016/10/2 15:474 #@Author: Derby5 #@File: whileloop.py6 7Count=08 whileTrue:9Count + = 1Ten ifCount >50 andCount<60 : One Continue A Print("you are the wind, I am the sand, wrapped around the horizon", Count) - " " - Else: the print ("This is a diedloop?", Count) - count + = 1 - " " - ifcount==100: + Print("Haha,this is good loop!") - BreakPrint Printing
Test additional code viewing methods
Way One:
#!/usr/bin/env python#-*-coding:utf-8-*-# @Time : 2016/10/2 15:47# @Author : derby# @File : Whileloop.pyc Ount=0while True: count + = 1 if Count >50 and count<60: continue print ("You are the wind I am the sand, tangled up to the horizon", Count) " Else: print (" This is a diedloop? ", Count) count + = 1 " if count==100 : Print ("Haha,this is Good loop!") Break
Python Loop printing