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)]) |
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
tuple = (1, 2, 3, 4) | |
for i in reversed(tuple): | |
print(str(i) + " ", end="") |
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
print('Compte à rebours :') | |
for i in reversed(range(10)): | |
print(i) |
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
numbers = list(range(10)) | |
print('liste de nombres :', numbers) | |
reversed(numbers) | |
print('liste de nombres après avoir appliqué reversed dessus :', numbers) | |
reversed_numbers = reversed(numbers) | |
print("liste de nombres dans l'ordre inverse obtenue avec reversed :", list(reversed_numbers)) |
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
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
print('liste de nombres :', numbers) | |
numbers.reverse() | |
print('liste de nombres après reverse() :', numbers) |
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)]) |
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
tuple = (1, 2, 3, 4) | |
for i in reversed(tuple): | |
print(str(i) + " ", end="") |
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
print('Compte à rebours :') | |
for i in reversed(range(10)): | |
print(i) |
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
numbers = list(range(10)) | |
print('liste de nombres :', numbers) | |
reversed(numbers) | |
print('liste de nombres après avoir appliqué reversed dessus :', numbers) | |
reversed_numbers = reversed(numbers) | |
print("liste de nombres dans l'ordre inverse obtenue avec reversed :", list(reversed_numbers)) |
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
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
print('liste de nombres :', numbers) | |
numbers.reverse() | |
print('liste de nombres après reverse() :', numbers) |
NewerOlder