Created
February 29, 2024 10:59
-
-
Save TGITS/9efe07e3dbebf3288caf2e89100f57d2 to your computer and use it in GitHub Desktop.
Exemple d'utilisation de reversed sur une chaine dans un boucle et dans une compréhension
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
bonjour = "Hello World" | |
print(bonjour) | |
for c in reversed(bonjour): | |
print(c, end="") | |
print() | |
print([c for c in reversed(bonjour)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment