count = 0
while count <= 5 :
count += 1
if count == 3:break
print("Loop",count)
else:
print("循环正常执行完啦")
print("-----out of while loop ------")
循环没有被break打断就会执行else 部分
count = 0
while count <= 5 :
count += 1
if count == 3:break
print("Loop",count)
else:
print("循环正常执行完啦")
print("-----out of while loop ------")
循环没有被break打断就会执行else 部分
转载于:https://www.cnblogs.com/hopelv/p/10061928.html