Answer the question
In order to leave comments, you need to log in
Is it possible to catch 2 exceptions at once?
Hello, I get a TimeoutException error and NoSuchElementException came out, I caught the second one, but I would like to know about the first exception, if you can explain in a stupid language for those who are in the tank (me), I will be grateful. Also would like to know it is possible to catch 2 exceptions at the same time?
Answer the question
In order to leave comments, you need to log in
maybe so
try:
# do something that may fail
except IDontLikeYouException, YouAreBeingMeanException:
# say please
try:
# do something that may fail
except IDontLikeYouException:
# say please
except YouAreBeingMeanException:
# say please
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question