Created
February 10, 2020 02:29
-
-
Save parzibyte/35cef592491acd6f54920451df7e5c7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# parzibyte.me/blog | |
diccionario = { | |
'A': 15, | |
'B': 20, | |
} | |
for clave in diccionario: | |
valor = diccionario.get(clave) | |
print("En la clave {} tenemos a {}".format(clave, valor)) | |
# Suponemos un diccionario de edades con cada nombre | |
nombres_edades = { | |
'Luis': 22, | |
'Maggie': 5, | |
'Pedro': 50, | |
} | |
for nombre in nombres_edades: | |
edad = nombres_edades.get(nombre) | |
print("{} tiene {} años".format(nombre, edad)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment