Well you can simply use:

d['word'] = [1,'something']

Or in case the 1 needs to be fetched:

d['word'] = [d['word'],'something']

Finally say you want to update a sequence of keys with new values, like:

to_add = {'word': 'something', 'word1': 'something1'}

you could use:

for key,val in to_add.items():
    if key in d:
        d[key] = [d[key],val]
Answer from willeM_ Van Onsem on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-dictionary-add-value-to-existing-key
Python Dictionary Add Value to Existing Key - GeeksforGeeks
July 23, 2025 - For example, consider a dictionary d = {'a': 1, 'b': 2}. If we want to add 3 to the value of key 'a', we can directly modify the value like this: d['a'] += 3, resulting in d = {'a': 4, 'b': 2}.
Discussions

How to add new values to existing dictionary in python - Stack Overflow
I am trying to create a python dictionary that has a collection of keys with multiple values per key. I want to be able to add values to an existing key in the dictionary. I have reviewed multiple More on stackoverflow.com
🌐 stackoverflow.com
How do you add to a value in a dictionary?
new_dict[word] += 1 This presumes it already has a value, and as written, will be the case. More on reddit.com
🌐 r/learnpython
13
1
October 14, 2021
way to add a key and append new value to dictionary of lists?
This is exactly what defaultdict is for. from collections import defaultdict my_dict = defaultdict(list) my_dict['a'].append(2) my_dict['a'].append(3) my_dict['w'].extend([7, 5]) More on reddit.com
🌐 r/learnpython
4
1
May 13, 2022
Adding new values to existing keys in nested dictionary
You do it just the same as appending to any list; using the append method. For instance, assuming Spain is the fourth item in the log: travel_log[3]["cities"].append("Barcelona"} More on reddit.com
🌐 r/learnpython
8
0
July 31, 2023
Top answer
1 of 16
4464

You create a new key/value pair on a dictionary by assigning a value to that key

Copyd = {'key': 'value'}
print(d)  # {'key': 'value'}

d['mynewkey'] = 'mynewvalue'

print(d)  # {'key': 'value', 'mynewkey': 'mynewvalue'}

If the key doesn't exist, it's added and points to that value. If it exists, the current value it points to is overwritten.

2 of 16
1365

I feel like consolidating info about Python dictionaries:

Creating an empty dictionary

Copydata = {}
# OR
data = dict()

Creating a dictionary with initial values

Copydata = {'a': 1, 'b': 2, 'c': 3}
# OR
data = dict(a=1, b=2, c=3)
# OR
data = {k: v for k, v in (('a', 1), ('b',2), ('c',3))}

Inserting/Updating a single value

Copydata['a'] = 1  # Updates if 'a' exists, else adds 'a'
# OR
data.update({'a': 1})
# OR
data.update(dict(a=1))
# OR
data.update(a=1)

Inserting/Updating multiple values

Copydata.update({'c':3,'d':4})  # Updates 'c' and adds 'd'

Python 3.9+:

The update operator |= now works for dictionaries:

Copydata |= {'c':3,'d':4}

Creating a merged dictionary without modifying originals

Copydata3 = {}
data3.update(data)  # Modifies data3, not data
data3.update(data2)  # Modifies data3, not data2

Python 3.5+:

This uses a new feature called dictionary unpacking.

Copydata = {**data1, **data2, **data3}

Python 3.9+:

The merge operator | now works for dictionaries:

Copydata = data1 | {'c':3,'d':4}

Deleting items in dictionary

Copydel data[key]  # Removes specific element in a dictionary
data.pop(key)  # Removes the key & returns the value
data.clear()  # Clears entire dictionary

Check if a key is already in dictionary

Copykey in data

Iterate through pairs in a dictionary

Copyfor key in data: # Iterates just through the keys, ignoring the values
for key, value in d.items(): # Iterates through the pairs
for key in d.keys(): # Iterates just through key, ignoring the values
for value in d.values(): # Iterates just through value, ignoring the keys

Create a dictionary from two lists

Copydata = dict(zip(list_with_keys, list_with_values))
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-add-to-dictionary
How to Add and Update Python Dictionaries Easily | DigitalOcean
October 16, 2025 - The update() method overwrites the values of existing keys with the new values. The following example demonstrates how to create a new dictionary, use the update() method to add a new key-value pair and a new dictionary, and print each result: site = {'Website':'DigitalOcean', 'Tutorial':'How ...
Top answer
1 of 3
5

TL;DR: You can append a value to a Python list (or array), but not to a dictionary.


Add key: value pair to dictionary

The syntax dictionary[key] = message1 changes the existing value of dictionary[key] to message if the key is already in the dictionary, and creates a key-value pair key: message1 if the key is not yet in the dictionary.

So instead of this...

Copyif key in dictionary:
    dictionary[key].append(message1)
else:
    dictionary[key] = message1

...you would use this:

Copydictionary[key] = message1

Update dictionary with different key: value pairs

If you want to update a dictionary with the values from another dictionary, you can do it this way:

Copydictionary_1.update(dictionary_2)

This modifies dictionary_1 in place, using the values for each key in dictionary_2.

If a key does not exist in dictionary_1, but exists in dictionary_2, then update will modify dictionary_1 based on dictionary_2, so that dictionary_1 includes the key-value pair key: dictionary_2[key].

Or, if a key exists in both dictionary_1 and dictionary_2, then update will overwrite the existing value in dictionary_1[key] with the value from dictionary_2[key].

So instead of this...

Copyif key in dictionary:
    dictionary[key].append(message1)
else:
    dictionary[key] = message1

...you would use this:

Copydictionary[key].update(message1)

This works only if the value of dictionary[key] is a dictionary.


Append values to list within dictionary

If you want a key to have multiple values, you can store the multiple values in a list:

Copydictionary = {key: [value_1, value_2, value_3]}

Then you can append another value to the list:

Copydictionary[key].append(value_4)

Result:

Copydictionary = {key: [value_1, value_2, value_3, value_4]}

So instead of this...

Copyif key in dictionary:
    dictionary[key].append(message1)
else:
    dictionary[key] = message1

...you would use this:

Copyif key in dictionary:
    dictionary[key].append(message1)
else:
    dictionary[key] = [message1]

If key already exists in dictionary, this appends message to dictionary[key]. Otherwise, it creates a new single-item list [message1] as the value of dictionary[key].

However, dictionary[key].append(message1) only works if the value of dictionary[key] is a list, not if the value is a dictionary.

2 of 3
2

You should be using a list to store these values. There's no reason to have nested dicts here. Especially since you're just using append here.

Your data would then look like this:

Copydata = {
  "key1":["value1-1", "value1-2","value1-3"],
  "Key2":["value2-1","value2-2", "value2-3"]}

Then you won't need an if statement just use dict.setdefault

Copydata.setdefault(key, []).append(message)
🌐
W3Schools
w3schools.com › python › python_dictionaries_add.asp
Python - Add Dictionary Items
Python Examples Python Compiler ... ❮ Previous Next ❯ · Adding an item to the dictionary is done by using a new index key and assigning a value to it: thisdict = { "brand": "Ford", "model": "Mustang", "year": 1964 } ...
🌐
DataCamp
datacamp.com › tutorial › python-dictionary-append
Python Dictionary Append: How to Add Key-Value Pairs | DataCamp
August 6, 2024 - You can add a new key-value pair to a Python dictionary using square bracket notation, like dictionary[key] = value. This method updates the dictionary in place. The .update() method is used to add multiple key-value pairs to a dictionary.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › add-a-keyvalue-pair-to-dictionary-in-python
Add a key value pair to Dictionary in Python - GeeksforGeeks
Explanation: update() adds key-value pairs to d, updating existing keys and adding new ones . ... This is the simplest way to add or update a key-value pair in a dictionary. We access the dictionary by specifying the key inside square brackets ...
Published   July 11, 2025
🌐
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.
🌐
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.
🌐
Sentry
sentry.io › sentry answers › python › add new keys to a dictionary in python
Add new keys to a dictionary in Python | Sentry
January 30, 2023 - The simplest way is to assign a value to a new key using Python’s indexing/square brackets syntax: prices = {"Apple": 1, "Orange": 2} # existing dictionary prices["Avocado"] = 3 # new key-value pair print(prices) # will print {"Apple": 1, "Orange": 2, "Avocado": 3}
🌐
Reddit
reddit.com › r/learnpython › how do you add to a value in a dictionary?
r/learnpython on Reddit: How do you add to a value in a dictionary?
October 14, 2021 -

I know how to update values in a dictionary. That's easy, and there are multiple ways to do it. However, what I'm looking for is how to add to a value in a dictionary. For example:

    def frequency_dictionary(words):
      new_dict = {}
      for word in words:
        if word not in new_dict:
          new_dict[word] = 1
        else:
           #?????
      return new_dict

I want this function to add 1 to the value of a word for each time it is featured in the words list. For example, print(frequency_dictionary(["apple", "apple", "cat", 1])) should return {"apple":2, "cat":1, 1:1}. The comment in the function with question marks is the part I am stuck on. What are some options to do this?

I tried looking this up, but all I got was info on how to update values, not add to them.

🌐
freeCodeCamp
freecodecamp.org › news › add-to-dict-in-python
Adding to Dict in Python – How to Append to a Dictionary
February 28, 2023 - 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 another dictionary or an iterable of key-value pairs as input.
🌐
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 - This method is simple and commonly used for adding individual keys. Q2. How to add new values in a dictionary in Python? A. Adding new values to a dictionary involves associating them with either an existing or new key.
🌐
datagy
datagy.io › home › python posts › python: add key:value pair to dictionary
Python: Add Key:Value Pair to Dictionary • datagy
December 19, 2022 - In this tutorial, you’ll learn how to add key:value pairs to Python dictionaries. You’ll learn how to do this by adding completely new items to a dictionary, adding values to existing keys, and dictionary items in a for loop, and using the zip() function to add items from multiple lists.
🌐
Flexiple
flexiple.com › python › add-values-to-dictionary-python
How To Add Values To A Dictionary In Python - Flexiple
Assign Values Using Unique KeysMerging Two Dictionaries Using update()Add Values To Dictionary Using Two Lists Of The Same LengthConverting A List To The DictionaryAdd Values To Dictionary Using The merge( | ) OperatorAdd Values To Dictionary Using The in-place merge( |= ) Operator ... Python dictionaries are versatile and essential for managing key-value pairs in programming.
🌐
GeeksforGeeks
geeksforgeeks.org › python › append-a-value-to-a-dictionary-python
Append a Value to a Dictionary Python - GeeksforGeeks
July 23, 2025 - Explanation: {**d, 'd': 4, 'e': 5} unpacks all key-value pairs from d ,adds 'd': 4 and 'e': 5 and creates a new dictionary. If a key already exists, its value is overwritten.
🌐
Guru99
guru99.com › home › python › python dictionary append: how to add key/value pair
Python Dictionary Append: How to Add Key/Value Pair
August 13, 2025 - To append an element to an existing dictionary, you have to use the dictionary name followed by square brackets with the key name and assign a value to it.
🌐
PhoenixNAP
phoenixnap.com › home › kb › devops and development › python: how to add items to dictionary
Python: How to Add Items to Dictionary
April 1, 2026 - To avoid overwriting existing data, use an if statement to check whether a key is present before adding a new item to a dictionary. The example syntax is: if key not in dictionary_name: dictionary_name[key] = value
🌐
Stack Abuse
stackabuse.com › python-how-to-add-keys-to-dictionary
Python: How to Add Keys to a Dictionary
March 8, 2023 - In Python, we can add multiple key-value pairs to an existing dictionary. This is achieved by using the update() method.