Exception
Domain: Software Engineering
π― Motivation
An error that occurs during execution. In Python: ValueError, TypeError, ZeroDivisionError, etc.
π Concrete Example
Exception: int(abc) -> ValueError: invalid literal for int(). The code stops unless you handle it: try: int(abc) except ValueError: print(βPlease enter a number.β). Handled gracefully.
π Analogy
An exception is like a fire alarm - something went wrong, and the program stops unless someone handles it. try/except is the fire drill: you know what to do when the alarm sounds.