Python - Exception Handling Fundamentals
Identify the error in this code snippet and select the correct fix:
try:
y = int('xyz')
except ValueError, TypeError:
print('Exception caught')Identify the error in this code snippet and select the correct fix:
try:
y = int('xyz')
except ValueError, TypeError:
print('Exception caught')except (ValueError, TypeError): to catch both exceptions.except ValueError, TypeError: with except (ValueError, TypeError): is the correct fix.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions