You can do

orig.update(extra)

or, if you don't want orig to be modified, make a copy first:

dest = dict(orig)  # or orig.copy()
dest.update(extra)

Note that if extra and orig have overlapping keys, the final value will be taken from extra. For example,

>>> d1 = {1: 1, 2: 2}
>>> d2 = {2: 'ha!', 3: 3}
>>> d1.update(d2)
>>> d1
{1: 1, 2: 'ha!', 3: 3}
Answer from mipadi on Stack Overflow
🌐
Great Learning
mygreatlearning.com › blog › it/software development › python dictionary append: how to add key/value pair?
Python Dictionary Append: How To Add Key/Value Pair?
October 14, 2024 - Yes, you can. When you use the update() method to append dictionary python, existing keys are updated with new values, but if there are any new keys, they are added to the dictionary without overwriting existing ones.
Discussions

Looping through Dictionary and add items to second dictionary
I am trying to loop through a dictionary and add values that satisfy my true statemen to a second dictionary At the moment, all I want to do is check and see if the value of each element is already a key in the entire dictionary and if so add it, otherwise go to next mydict={“John” : ... More on discuss.python.org
🌐 discuss.python.org
0
September 25, 2022
How to append two dictionaries so they dont overwrite each other?
Create a list and append the resulting dict there, no need to update the same dict over and over More on reddit.com
🌐 r/learnpython
13
5
February 16, 2023
Python dictionary in to html table
Answer link : https://codehunter.cc/a/flask/python-dictionary-in-to-html-table ... Be the first to share what you think! ... Single ErrorDocument directive to catch all errors... ... Form submit with AJAX passing form data to PHP without... ... How to add comment in apache httpd.conf not as ... More on reddit.com
🌐 r/codehunter
1
[Python 3] Add a value to a dictionary containing lists for each key, using a dict comprehension if the key already exists. Otherwise, if the key doesn't exist, create the key, value pair(value stored in list).

collections.defaultdict(list)?

More on reddit.com
🌐 r/learnpython
6
3
July 4, 2014
🌐
DataCamp
datacamp.com › tutorial › python-dictionary-append
Python Dictionary Append: How to Add Key-Value Pairs | DataCamp
August 6, 2024 - Learn Python dictionary append techniques such as square bracket notation, the .update() method for bulk additions, and .setdefault() for conditional inserts.
🌐
W3Schools
w3schools.com › python › python_dictionaries_add.asp
Python - Add Dictionary Items
Python Sets Access Set Items Add Set Items Remove Set Items Loop Sets Join Sets Frozenset Set Methods Set Exercises Code Challenge Python Dictionaries
🌐
GeeksforGeeks
geeksforgeeks.org › python › append-a-value-to-a-dictionary-python
Append a Value to a Dictionary Python - GeeksforGeeks
July 23, 2025 - If a key already exists, its value is updated otherwise, the key-value pair is added. Directly assigning a value to a new key is the fastest way to append a single key-value pair to a dictionary. This method updates the dictionary in-place without creating a new one.
🌐
Python documentation
docs.python.org › 3 › tutorial › datastructures.html
5. Data Structures — Python 3.14.3 documentation
It is best to think of a dictionary as a set of key: value pairs, with the requirement that the keys are unique (within one dictionary). A pair of braces creates an empty dictionary: {}. Placing a comma-separated list of key:value pairs within the braces adds initial key:value pairs to the dictionary; this is also the way dictionaries are written on output.
🌐
freeCodeCamp
freecodecamp.org › news › add-to-dict-in-python
Adding to Dict in Python – How to Append to a Dictionary
February 28, 2023 - If there is a key 'c' in the dictionary already, the value would be updated to 3. Multiple key-value pairs can be simultaneously added to a dictionary using the update() method. This method inserts new entries into the original dictionary from ...
Find elsewhere
🌐
JanBask Training
janbasktraining.com › community › python-python › append-a-dictionary-to-a-dictionary
Append a dictionary to a dictionary | JanBask Training Community
May 12, 2025 - Appending one dictionary to another in Python is commonly done when you want to combine or update key-value pairs. While Python dictionaries don’t have a direct “append” method like lists, you can merge them using a few simple approaches. ... dict1 = {'a': 1, 'b': 2} dict2 = {'c': 3, 'd': 4} dict1.update(dict2) print(dict1) # {'a': 1, 'b': 2, 'c': 3, 'd': 4} update() adds all key-value pairs from dict2 to dict1.
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-add-to-dictionary
How to Add and Update Python Dictionaries Easily | DigitalOcean
October 16, 2025 - However, dictionary keys are immutable and need to be unique within each dictionary. This makes dictionaries highly efficient for lookups, insertions, and deletions. Dictionaries are widely used in Python for various applications such as counting occurrences, grouping data, and storing configurations. Despite their versatility, there’s no built-in add method for dictionaries.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-nested-dictionary
Python Nested Dictionary - GeeksforGeeks
July 12, 2025 - This example creates a nested dictionary to store details of multiple students. Each student is added as a key and their information (name, age, grade) is stored in an inner dictionary.
🌐
Career Karma
careerkarma.com › blog › python › python add to dictionary: a guide
Python Add to Dictionary: A Guide | Career Karma
December 1, 2023 - Instead, you add an item to a dictionary by inserting a new index key into the dictionary, then assigning it a particular value. This tutorial discussed, with an example, how to add an item to a Python dictionary.
🌐
Codecademy
codecademy.com › article › python-dictionary-append-how-to-add-items-to-dictionary
Python Dictionary Append: How to Add Items to Dictionary | Codecademy
The most direct and commonly used way to add or update items in a Python dictionary is by using square brackets ([]) with the assignment operator (=). This method allows you to assign a value to a new key or update the value of an existing key.
🌐
Note.nkmk.me
note.nkmk.me › home › python
Add and Update an Item in a Dictionary in Python | note.nkmk.me
August 25, 2023 - This article explains how to add an item (key-value pair) to a dictionary (dict) or update the value of an existing item in Python. Add or update a single item in a dictionary Add or update multiple i ...
🌐
Cisco
ipcisco.com › home › python add to dictionary
Python Add To Dictionary | update() method | append() method ⋆ IpCisco
December 24, 2021 - It will contain the updated member of the dictionary. In other words, it will contain new value of RU as 30. {'vendor': 'Cisco', 'model': '9000 series', 'RU': 30} Update method can get only one attribute. If you use one more attribute, it will give an error as output. To update one more key:pair, we should use differenet update lines. Let’s do another example with python dictionary update method and change all the key:value pairs.
🌐
Python.org
discuss.python.org › python help
Looping through Dictionary and add items to second dictionary - Python Help - Discussions on Python.org
September 25, 2022 - I am trying to loop through a dictionary and add values that satisfy my true statemen to a second dictionary At the moment, all I want to do is check and see if the value of each element is already a key in the entire dictionary and if so add it, otherwise go to next mydict={“John” : “House”, “Eric” : “Turtle”, “Jimmy” : “John”, “Charles” : “Eric”} myresult={“Jimmy” : “John”, “Charles” : Eric"} ← these two satisfy the true statement of the value being a key in the dictionary (i.e. value “Jo...
🌐
PhoenixNAP
phoenixnap.com › home › kb › devops and development › python: how to add items to dictionary
Python: How to Add Items to Dictionary
December 22, 2025 - Learn how to add items to a Python dictionary in this guide through example code. See how you can add multiple items at once through loops.
🌐
Reddit
reddit.com › r/learnpython › how to append two dictionaries so they dont overwrite each other?
r/learnpython on Reddit: How to append two dictionaries so they dont overwrite each other?
February 16, 2023 -

I have a script that continuosly generates dictionaries with the same keys but different values. I want to write the results out in a json file but to do that i need to do load & dump into the file.

with open('sample.json') as f:
    data = json.load(f)

data.update(results)

with open('sample.json', 'w') as f:
    json.dump(data, f)

The above code only overwrites the existing data it doesn't append it. I figured it is beacuse the dictionaries have the same keys because if i try it with a different dictionary template, the append does happen.

Is there a way to append similar dictionaries without overwriting?

🌐
Analytics Vidhya
analyticsvidhya.com › home › 5 methods to add new keys to a dictionary in python
5 Methods to Add New Keys to a Dictionary in Python
February 7, 2025 - Understand the differences between the available methods for adding keys to dictionaries and their appropriate use cases. Explore practical examples demonstrating adding and manipulating key-value pairs in Python dictionaries.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-dictionary
Python Dictionary - GeeksforGeeks
... d = { "name": "Kat", 1: "Python", (1, 2): [1,2,4] } # Access using key print(d["name"]) # Access using get() print(d.get("name")) ... New items are added to a dictionary using the assignment operator (=) by giving a new key a value.
Published   January 15, 2026
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › append python dictionary to dictionary
Append Python Dictionary to Dictionary - Spark By {Examples}
May 31, 2024 - Python provides an update() method in dict class that can be used to append a new dictionary at the ending point of the given dictionary. The update() method allows the dictionary as an argument and adds its key-value pairs to the original ...