while else语句

#else 用于检测循环中间是否有被打断
count = 0
while count <=5:
print('loop',count)
count +=1
else:
print('程序正常执行完毕,中间没有被打断!')
posted @ 2018-01-27 09:27  andyzhang-  阅读(193)  评论(0编辑  收藏  举报