AI engineering glossary · Python core
What is raise?
raise: A statement that deliberately triggers an exception, either a new one or the current one again. It signals an error condition to the caller, for example when the input is invalid.
raise: an example
if age < 0: raise ValueError('age cannot be negative') stops the function with that message.
Related terms
More Python core terms
Where you learn it
raise is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.