agregar valor al diccionario de python
dict[key] = value
anexar diccionario de python
>>> d1 = {1: 1, 2: 2}
>>> d2 = {2: 'ha!', 3: 3}
>>> d1.update(d2)
>>> d1
{1: 1, 2: 'ha!', 3: 3}
la adición de un elemento en el diccionario de python
mydict = {'score1': 41,'score2': 23}
mydict['score3'] = 45 # using dict[key] = value
print(mydict)
cómo agregar a un diccionario en python
d = {'a': 1, 'b': 2}
print(d)
d['a'] = 100 # existing key, so overwrite
d['c'] = 3 # new key, so add
d['d'] = 4
print(d)
python anexar al diccionario
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)