Labs ICT
Pro Login

Exceptions

1 min read | Python Tutorial

Want the full learning experience?

Get structured courses, certificates, projects, and instructor support with LabsICT Pro.

Explore Pro Courses

Python Exception Types

Errors that happen during execution are called exceptions. Python has built-in types like TypeError, ValueError, ZeroDivisionError, and FileNotFoundError. You can catch them with try-except or raise them on purpose with raise.

try:
    num = int("hello")
except ValueError:
    print("That's not a number!")

raise RuntimeError("Something went wrong")