In this example we will show how to define as many exception blocks as you want in Python.
Source Code
try:
x = int('a')
except ValueError:
print('String is invalid literal for int() with base 10.')
except:
print('Other errors occurred!')
Output:
String is invalid literal for int() with base 10.