-
-
Save stephengruppetta/bb12e8635978c6e29c0bbc2a9cd8b459 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
some_names = [ | |
"Robert", | |
"Ishaan", | |
"Max", | |
"Trevor", | |
"Alexandra", | |
"Albert", | |
"Christine", | |
] | |
reordered_names = sorted( | |
some_names, | |
key=lambda item: item.lower().count("a"), | |
) | |
print(*reordered_names, sep="\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment