In Python, you can update a dictionary by using the update() method or by directly assigning values to specific keys. Here is the example for that:
Using the update() method:
my_dict = {"name": "John", "age": 25, "city": "New York"}
# Update the dictionary with new key-value pairs
my_dict.update({"age": 26, "city": "San Francisco", "occupation": "Engineer"})