84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
try: 语句A except xxx: 语句A
要是再出现异常怎么循环下去?
学习是最好的投资!
Try again in except.
try: 语句A except Exception as e: try: 语句A except Exception as e: # 继续
But this is stupid. If you really want to implement an infinite loop to catch exceptions, write like this:
def func(): try: 语句A except Exception as e: return False else: return True while not func(): pass # Or do something
According to the way you write it, the error should be ignored and statement A should be executed? Written specifically by yourself.
循环: try: 语句A except: pass #这是忽略错误
Why is there such a strange demand? You should consider changing the direction. This is obviously an endless loop
Try again in except.
But this is stupid. If you really want to implement an infinite loop to catch exceptions, write like this:
According to the way you write it, the error should be ignored and statement A should be executed?
Written specifically by yourself.
Why is there such a strange demand? You should consider changing the direction. This is obviously an endless loop