Exceptions | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Exceptions

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 Answers
+ 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