四:Python的while循环

while循环:

 while count<10:
      print(count)
        #count=100
        count=count+1
        
      print(123)

while循环break:终止所有循环

count=0
while count<10:
               count=count+1
               print(count)
           break
           print(1111111)
print('end')

while循环continue:终止当前循环,开启下面循环

count=0
while count<10:
    if count==7:
    count=count+1
    countinue

    print(count)
    count=count+1

猜你喜欢

转载自www.cnblogs.com/liu-zhijun/p/9419899.html
今日推荐