Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created March 19, 2018 17:39
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/8c8ac2a37d261073e8cc62d532ce8f7d to your computer and use it in GitHub Desktop.
Save Fhernd/8c8ac2a37d261073e8cc62d532ce8f7d to your computer and use it in GitHub Desktop.
OrtizOL. Operaciones básicas sobre diccionarios. Python.
precios_productos = {
'Mouse': 23.5,
'Teclado': 42.7,
'Memoria USB': 13.9,
'Speakers': 29.9,
'Disco blue-ray': 7.5,
'Audífonos': 35.5
}
print('Máximo:', min(zip(precios_productos.values(), precios_productos.keys())))
print('Mínimo:', max(zip(precios_productos.values(), precios_productos.keys())))
print('Diccionario ordenado: ', sorted(zip(precios_productos.values(), precios_productos.keys())))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment