-
What do you call an error caused by code that does not follow the rules of the Python language?
a syntax error
-
What do you call an error that causes the code to give incorrect results?
a logic error
-
What do you call an error that occurs when a value in a Python statement causes the statement to fail?
a runtime error
-
What does the Python interpreter do when it comes upon a runtime error?
creates an exception object
-
When does the Python interpreter create an exception object?
when a runtime error occurs
-
What type of statement can be used to deal with an exception?
a try/except statement
-
What should you put in the first block of the above statement?
any code that might cause a runtime error
-
What code should you put in the second block of this statement?
code that deals with the exception
-
What happens when an exception is encountered in the
try
block
of such a statement?
the interpreter stops running the code in the 1st block and jumps to the code in the 2nd block