还有一种用法就是遇到错误时直接中断整个for循环:. try: for i in range(x):. i += 1. print(i). except: pass. 总之try+except就是当try的从属代码 ...
確定! 回上一頁