add to list dict python code example
Example 1: python append to dictionary
dict = {1 : 'one', 2 : 'two'}
# Print out the dict
print(dict)
# Add something to it
dict[3] = 'three'
# Print it out to see it has changed
print(dict)
Example 2: Python dict add item
# This automatically creates a new element where
# Your key = key, The value you want to input = value
dictionary_name[key] = value