Assert
assert condition, "msg" checks a belief while developing. If False, AssertionError. Good for internal checks, not for user input validation in production (can be disabled with python -O).
Example — assert marks >= 0. If marks is -5, the script stops with a clear message.
Output — ok 72. If marks were -5, AssertionError. python -O can skip asserts.
Exam tip
What assert does + python -O warning.