Assign to a key to add or update:
person = {"name": "Alice"}
person["age"] = 30 # Add new key
person["name"] = "Bob" # Update existing key
print(person) # {"name": "Bob", "age": 30}
If the key exists, the value is replaced. If it doesn't exist, the key-value pair is added.
This is different from lists, where assigning to an out-of-range index causes an error.