8 Errors and Exceptions
In many languages, exceptions are regarded as the archnemeses of programmers and the hallmarks of some degree of failure. Something, somewhere was used improperly! Python developers, on the other hand, recognize exceptions as friends that help write better code.
Python offers many familiar error-handling tools, but the way we use them may look different from what you’re used to. These tools can help you do more than clean up messes. You might even say, error handling in Python is “exceptional.”
I’ll start by demonstrating what exceptions look like in Python and how to read their accompanying messages. I’ll cover catching ...
Get Dead Simple Python now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.