Created
December 26, 2019 13:34
-
-
Save Fhernd/ff0b2d12e5bea79aad80b808dc40e5a9 to your computer and use it in GitHub Desktop.
# Ejercicio 429: Encontrar el índice de un elemento en una tupla.
This file contains hidden or 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
# Ejercicio 429: Encontrar el índice de un elemento en una tupla. | |
lenguajes = ('Python', 'C#', 'JavaScript', 'C++', 'PHP') | |
indice = lenguajes.index('JavaScript') | |
print(indice) | |
try: | |
indice = lenguajes.index('php') | |
print(indice) | |
except ValueError as e: | |
print('Ha ocurrido un error:', e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment