while循环

死循环:

while 1 == 1:
    print("ok")

约束循环:

count = 0
while count < 6:
    print('ok')
    count = count + 1
print(123)
count = 0
while count < 6:
    print(count)
    count = count + 1
print(123)

  

 

posted @ 2025-05-19 20:16  大猫学编程  阅读(9)  评论(0)    收藏  举报