Chapter 12 - Exceptions
Exercise 1: Rescuing Exceptions
The call to trip_over_curb
raises an exception. Instead of allowing execution to halt, rescue the exception, and print the string "Caught you!"
.
Here’s the output:
The call to trip_over_curb
raises an exception. Instead of allowing execution to halt, rescue the exception, and print the string "Caught you!"
.
Here’s the output: