Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created March 19, 2018 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/055caaad71e28eafca6797fbd2250072 to your computer and use it in GitHub Desktop.
Save Fhernd/055caaad71e28eafca6797fbd2250072 to your computer and use it in GitHub Desktop.
OrtizOL. Multi-diccionario. Python.
from collections import defaultdict
dic_lista = defaultdict(list)
dic_lista['primos'].append(2)
dic_lista['primos'].append(3)
dic_lista['primos'].append(5)
dic_lista['cuadrados'].append(1)
dic_lista['cuadrados'].append(4)
dic_lista['cuadrados'].append(9)
dic_lista['cuadrados'].append(16)
for llave, valores in dic_lista.items():
print(llave, ': ', valores)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment