Created
March 10, 2017 08:51
-
-
Save ken8203/3b38c57ec73f2f2c5fafdf3e7578d45a to your computer and use it in GitHub Desktop.
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
| values = [ | |
| (0.1, 'a'), | |
| (0.004, 'c'), | |
| (0.59643590, 'd'), | |
| (100, 'k') | |
| ] | |
| values.sort(key=lambda x: x[0]) | |
| print values | |
| values.sort(key=lambda x: x[0], reverse=True) | |
| print values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment