“cómo agregar dict a dict en python” Código de respuesta

Python adjuntar 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)
Random boi

cómo agregar dict a dict en python

test={'item1': 1,
       'item2': 2,
      }
default_data = test

default_data.update({'item3': 3})
# or
default_data['item3'] = 3
Rezwana Sultana

Respuestas similares a “cómo agregar dict a dict en python”

Preguntas similares a “cómo agregar dict a dict en python”

Más respuestas relacionadas con “cómo agregar dict a dict en python” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código