Created
December 26, 2019 22:14
-
-
Save Fhernd/b52f2b8add2837d5aebfe4fb7d83c40c to your computer and use it in GitHub Desktop.
# Ejercicio 439: Orden descendente una lista de tuplas por el valor de punto flotante de cada tupla.
This file contains hidden or 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
# Ejercicio 439: Orden descendente una lista de tuplas por el valor de punto flotante de cada tupla. | |
productos = [('Mouse', '29.5'), ('Teclado', '77.9'), ('Auriculares', '15.9'), ('Deademas', '49.9')] | |
print(productos) | |
resultado = sorted(productos, key=lambda p: float(p[1]), reverse=True) | |
print(resultado) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment