Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Apr 21, 2019
Embed
What would you like to do?
def invertir_cadena(cadena):
return cadena[::-1]
def invertir_cadena_manual(cadena):
cadena_invertida = ""
for letra in cadena:
cadena_invertida = letra + cadena_invertida
return cadena_invertida
print(invertir_cadena("Hola"))
print(invertir_cadena_manual("Hola"))
print(invertir_cadena("parzibyte.me"))
print(invertir_cadena_manual("parzibyte.me"))
print(invertir_cadena("All the young dudes"))
print(invertir_cadena_manual("All the young dudes"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment