Last active
June 16, 2022 08:46
-
-
Save plavjanik/10e2d76306f8671dbd88b7daf1bfaf64 to your computer and use it in GitHub Desktop.
Looping in sorted order
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
colors = ["cyan", "magenta", "yellow", "black"] | |
for color in sorted(colors): | |
print(color) | |
for color in sorted(colors, reverse=True): | |
print(color) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment