Created
January 20, 2024 17:09
-
-
Save TGITS/ad2ca5ae5f9a19fb9e52f6c4d3c2d85a 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