try block inside while statement

前端 未结 4 1325
小鲜肉
小鲜肉 2020-12-17 01:54

I\'m just starting out with Python 2.7 and I don\'t understand why something is happening:

In the following code, an embellished version of an example from the pytho

4条回答
  •  再見小時候
    2020-12-17 02:22

    It is probably because of the break statement, which leaves the loop. The break statement is only reached when there is no exception in the line before.

提交回复
热议问题