Mega Code Archive

 
Categories / Python Tutorial / Statement
 

Catching Two Exceptions with One Block

try:    x = input('Enter the first number: ')    y = input('Enter the second number: ')    print x/y  except (ZeroDivisionError, TypeError):    print 'Your numbers were bogus...'