0
Only "Except" always at the end?
This code doesn't work but if I put except at the end of the code works properly... So always the "except" must be at the end? //// try: word = 2 print(word / 0) except: print("An error occurred") except ZeroDivisionError: print ("Dividiendo con cero") /// RUN //// File "..\Playground\", line 3 ^ SyntaxError: default 'except:' must be last ////
2 odpowiedzi
0
This is just the way python does things first it wants to check what to do if specific exceptions are thrown then it likes to know what to do if any of the other types of exceptions are thrown.
0
i is very interesting