Created
December 15, 2018 23:55
-
-
Save parzibyte/5d30d43e984c3d10ed11b4f30990418f to your computer and use it in GitHub Desktop.
Equivalente a Switch en Python created by parzibyte - https://repl.it/@parzibyte/Equivalente-a-Switch-en-Python
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
menu = """Bienvenido a la tienda. | |
1 - Insertar producto | |
2 - Ver todos | |
3 - Actualizar | |
4 - Eliminar | |
5 - Salir | |
""" | |
print(menu) | |
eleccion = int(input("Elige: ")) | |
if eleccion is 1: | |
print("Insertar") | |
elif eleccion is 2: | |
print("Ver") | |
elif eleccion is 3: | |
print("Actualizar") | |
elif eleccion is 4: | |
print("Eliminar") | |
elif eleccion is 5: | |
print("Salir") | |
else: | |
#Equivalente a 'default' | |
print("Ninguna opción válida seleccionada") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment