Get your own Python server Result Size: 625 x 565
x
 
fruit = {"name": "apple", "color": "red"}
try:
  print(fruit["price"])
except KeyError:
  print("You are trying to access a dictionary item that does not exist!")
except:
  print("Something else went wrong")
You are trying to access a dictionary item that does not exist!