Exception Handling — Chapter Test

Answer all 5 questions, then submit. You need 60% to pass. Log in to save progress.

Question 1
What is an exception?
AA grammar mistake that stops code from running
BA runtime error that occurs while the program runs and can be caught
CA type of comment
DA function
Question 2
Which block runs ONLY if no exception occurred?
Atry
Bexcept
Celse
Dfinally
Question 3
Which block runs ALWAYS, whether or not an exception happened?
Atry
Bexcept
Celse
Dfinally
Question 4
Which exception does int("abc") raise?
ATypeError
BValueError
CIndexError
DKeyError
Question 5
Accessing a dictionary key that doesn't exist (with d[key]) raises…
AIndexError
BKeyError
CNameError
DValueError