Answer the question
In order to leave comments, you need to log in
How to continue the execution of a Python 3 program after some of the commands gave an error?
Is it possible to make python work after NOT executing a certain command? i.e. if x==1: ... and the x variable is not specified, we print "Error" and continue the program execution. Many thanks in advance.
Answer the question
In order to leave comments, you need to log in
https://docs.python.org/3/tutorial/errors.html
try:
x = 1/0
except ZeroDivisionError:
print("Try in another world")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question