10.14. Exercises
Raising Exceptions. Which of the following can RAISE exceptions during program execution? Note that this question does not ask what may CAUSE exceptions.
a) the user
b) the interpreter
c) the program
d) all of the above
e) only (b) and (c)
f) only (a) and (c)
Raising Exceptions. Referring to the list in the problem above, which could raise exceptions while running within the interactive interpreter?
Keywords. Name the keyword(s) which is(are) used to raise exceptions.
Keywords. What is the difference between try-except and try-finally?
Exceptions. Name the exception that would result from executing the following pieces of Python code from within the interactive interpreter (refer back to Table 10.2 for a list of all built-in exceptions): ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access