Created
January 1, 2019 00:43
-
-
Save parzibyte/3799817b929345a2f8acd03457b23450 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
""" | |
2 formas de leer una cadena carácter por carácter | |
en Python 3: con y sin índice | |
@author parzibyte | |
""" | |
cadena = "¡Hola, mundo!" | |
# Método 2, con índice | |
for indice in range(len(cadena)): | |
caracter = cadena[indice] | |
print("En el índice {} tenemos a '{}'".format(indice, caracter)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment