student = {
    "name": "sagar",
    "id": 1
}
try:
    val = student["last_name"]
except Exception as error:
    print("Key does not exist in dictionary")
    print(error)
print("this code executes")

c6692539b725b7035b9c6adf0cc47b9fb26d0a6a
<mask token>

<mask token>
try:
    val = student['last_name']
except Exception as error:
    print('Key does not exist in dictionary')
    print(error)
print('this code executes')

student = {'name': 'sagar', 'id': 1}
try:
    val = student['last_name']
except Exception as error:
    print('Key does not exist in dictionary')
    print(error)
print('this code executes')

student = {
    "name": "sagar",
    "id": 1
}
try:
    val = student["last_name"]
except Exception as error:
    print("Key does not exist in dictionary")
    print(error)
print("this code executes")
