Problem Statement
How do you catch multiple specific exception types in one handler?
Explanation
Provide a tuple of exception classes in one except clause. Python checks the raised error against any of the types in the tuple.
This keeps handlers concise when the recovery action is identical for several related exceptions.
Code Solution
SolutionRead Only
try:
risky()
except (KeyError, IndexError):
recover()