jjzjj

python: try/except/else and continue 语句

为什么下面的python代码片段的输出NOT只是Noexception:1,因为在第一次迭代期间没有引发异常。来自python文档(https://docs.python.org/2.7/tutorial/errors.html)。Thetry...exceptstatementhasanoptionalelseclause,which,whenpresent,mustfollowallexceptclauses.Itisusefulforcodethatmustbeexecutedifthetryclausedoesnotraiseanexception.$cathello.pyfo