Exceptions | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite


try: c = 10 print(c/0) print(c + "u") print(c/2) except ZeroDivisionError: print("divided by zero") except TypeError: print("incompatible characters") The lesson tells us that we can compute multiple exceptions. But why am I only getting the output of one exception( the first one)?

5th Apr 2022, 9:23 PM
Oluwadurotimi Efunshile
2 Réponses
+ 4
Execution of the try block stops as soon as the first error occurs.
5th Apr 2022, 9:40 PM
Simon Sauter
Simon Sauter - avatar
+ 1
Thanks a lot ūüėäūüĎć
5th Apr 2022, 9:51 PM
Oluwadurotimi Efunshile