From the course: Python Essential Training
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Errors and exceptions - Python Tutorial
From the course: Python Essential Training
Errors and exceptions
We've seen a lot of errors working with Python so far. You know, it's that thing that happens when you divide something by zero. You get a zero division error. Working with Python, you'll see that sometimes these things are called errors and sometimes they're called exceptions. And if you read the official Python documentation, you'll find something like exceptions are decided during runtime and are retriable. Errors are not retriable. Well, there are so many, well, exceptions to this rule, even within the official Python code, it's not really worth worrying too much about. They all work the same anyway. Controversial opinion, but errors and exceptions are the same thing. All Python errors and exceptions ultimately extend a class called the base exception. So division by zero error extends arithmetic error, which extends the exception, which extends baseException. And baseException is the thing that gives us really useful and powerful properties of exceptions, which is to halt the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.