-
-
Save parzibyte/4ea35bf2f564897324cc3d7fc1493394 to your computer and use it in GitHub Desktop.
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
# https://parzibyte.me/blog | |
nombres = ["Luis", "María", "Pedro", "Mario", "Leon", "Claire"] | |
edades = [6, 23, 6, 1, 2, 3, 4] | |
print("Nombres originalmente: ") | |
print(nombres) | |
print("Edades originalmente: ") | |
print(edades) | |
# Los ordenamos. sort los ordena internamente, es decir, no regresa nada | |
nombres.sort() | |
edades.sort() | |
print("Nombres ordenados: ") | |
print(nombres) | |
print("Edades ordenadas: ") | |
print(edades) | |
""" | |
Salida: | |
Nombres originalmente: | |
['Luis', 'María', 'Pedro', 'Mario', 'Leon', 'Claire'] | |
Edades originalmente: | |
[6, 23, 6, 1, 2, 3, 4] | |
Nombres ordenados: | |
['Claire', 'Leon', 'Luis', 'Mario', 'María', 'Pedro'] | |
Edades ordenadas: | |
[1, 2, 3, 4, 6, 6, 23] | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment