Last active
February 11, 2024 02:57
-
-
Save dcortesnet/8a411962ddfcd840e74663546a4d768f to your computer and use it in GitHub Desktop.
Python ordenar un array 2d por un dato
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
students = [['Harry', 37.21], ['Berry', 37.21], ['Tina', 37.2], ['Akriti', 41], ['Harsh', 39]] | |
data_sorted = sorted(students, key=lambda x: x[1]) | |
print(data_sorted) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment