try/except is here to save the day if some code fails. We've seen errors before. In Jupyter, they appear as text highlighted in red when we do something wrong. In many cases, however, it is hard to predict whether an error will occur—for example, if we're working with an external database or service, there is no guarantee that everything will work as it should all the time. Before we learn how to mitigate those potential exceptions, let's briefly review what the exception is and why we should create our own ones.
Handling exceptions with try/except and try/finally
Exceptions
But what are the exceptions? You can think of them as warning messages letting us know about computation issues and halting the...