python
try:
pass
except Exception as e:
pass
python
try:
object.undefined_attribute
except AttributeError as e:
pass
python
try:
file = open('nonexistent_file.txt', 'r')
except FileNotFoundError as e:
pass
python
try:
my_list = [1, 2, 3]
print(my_list[4])
except IndexError as e:
pass
python
try:
my_dict = {'name': 'John', 'age': 25}
print(my_dict['address'])
except KeyError as e:
pass
python
try:
pass
except RuntimeError as e:
pass