Skip to content
Error Handling and Debugging Basics

Error Handling and Debugging Basics

Error handling makes programs more resilient. With try and except, we can catch problems without letting the program crash.

Example

try:
    value = int(input("Number: "))
except ValueError:
    print("Input must be a number")

Get used to reading the traceback to find the first relevant line and fix the root cause.

Last updated on