The get() method returns None instead of raising an error:
person = {"name": "Alice"}
print(person.get("name")) # Alice
print(person.get("height")) # None (no error)
You can provide a default value:
height = person.get("height", 0)
print(height) # 0
Use get() when a key might not exist. Use square brackets when you're sure it does.