Skip to content

Glossary: Python Basics

try and except

Also written: try, except, try/except

A way to catch errors. Risky code goes in `try:`, and an `except` block naming the error runs if it happens, so the program carries on instead of crashing.

Where the book teaches it

Related terms

raiseValueError