AI engineering glossary · Python core

What is exception?

Exception: An event that occurs while a program runs and disrupts normal flow, represented by an object such as ValueError or KeyError. Unless it is caught, the exception ends the program with a traceback.

Level: beginnerTopic: Python core

Exception: an example

int('abc') raises ValueError, and 10 / 0 raises ZeroDivisionError.

Related terms

More Python core terms

Where you learn it

Exception is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.