8. Errors and Exceptions — Python 3.15.2 documentation
Errors detected during execution are called exceptions and are not unconditionally fatal: you will soon learn how to handle them in Python programs.8.4. Raising Exceptions¶. The raise statement allows the programmer to force a specified exception to occur. For example