In which use cases or examples, while else in python is specifically useful?

前端 未结 0 1791
遇见更好的自我
遇见更好的自我 2021-01-30 03:55
n = 5
while n > 0:
    print("hi")
    i-=1
else:
    print("Loop is finished")

I could have done the same thing wit

相关标签:
回答
  • 消灭零回复
提交回复
热议问题