Test your knowledge of Error Handling • 10 Questions
What type of error does print("Age: " + 25) produce?
print("Age: " + 25)
What does the except block do?
except
What error does int("hello") produce?
int("hello")
When does the finally block run?
finally
What is a traceback?
When does the else block (in try/except/else) run?
else
What does the raise keyword do?
raise
Which debugging technique involves explaining your code line by line to find bugs?
What error does my_dict = {"a": 1}; print(my_dict["b"]) produce?
my_dict = {"a": 1}; print(my_dict["b"])
Why should you catch specific exceptions rather than using a bare except:?
except: