An exception handle is not an error, is it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

An exception handle is not an error, is it?

In the code below, Solo Learn cosiders that two errors occours, however the first exception is handle so it's not a error. try: print(1/0) except ZeroDivisionError: raise ValueError

6th Aug 2017, 10:28 PM
Myke Albuquerque Pinto de Oliveira
Myke Albuquerque Pinto de Oliveira - avatar
3 Answers
+ 7
If you handle an exception it isn't an error.
6th Aug 2017, 10:44 PM
J.G.
J.G. - avatar
+ 6
However, to handle an exception, you raised an error.
6th Aug 2017, 10:45 PM
J.G.
J.G. - avatar
+ 1
if you don't handle the exception they may crash your program
6th Aug 2017, 10:33 PM
Andrés04_ve
Andrés04_ve - avatar