Labs ICT
🎓 SIWES/IT Login

Exceptions

1 min read | Python Tutorial
🎓

Doing SIWES / IT attachment?

Get a structured training programme, a supervised digital logbook, and a completion certificate with LabsICT SIWES / IT.

Explore SIWES / IT Training

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")