OnlinePython

Error Handling Exercise

Question 1 of 4

Which code correctly handles multiple exception types?

def safe_division(a, b):
    # Handle both type and division errors
    try:
        result = a / b
        return result