python_while_else

#coding=utf-8
count = 0
while count <=5:
    count +=1
    if count == 3:break
    print("loop",count)
else:
    print("正常执行完了!")
print("----over----")
#当循环被break打断的话就不会执行else

 

posted @ 2018-08-23 09:11  王学长  阅读(142)  评论(0编辑  收藏  举报