Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Este código tiene 5 errores de lógica ¿Sabrías encontrarlos?
- print("""
- 1 Saludar
- 2 Presentarse
- 3 Pedir información
- 4 Despedirse""")
- op = int(input("Elige un opción del 1 al 4:"))
- while True :
- if op == 1:
- print("Bien venido")
- if op == 2:
- print("Soy tu asesor personal")
- if op == 3:
- print("¿Cual es tu nombre")
- nombre = input()
- elif op == 4:
- print("Hasta la proxima")
- break
- print("""
- 1 Saludar
- 2 Presentarse
- 3 Pedir información
- 4 Despedirse""")
- op = int(input("Elige un opción del 1 al 4:"))
- # Código corregido
- while op != "4" :
- print("""
- 1 Saludar
- 2 Presentarse
- 3 Pedir información
- 4 Despedirse""")
- op = input("Elige un opción del 1 al 4:")
- if op == "1":
- print("Bien venido")
- elif op == "2":
- print("Soy tu asesor personal")
- elif op == "3":
- nombre = input("¿Cual es tu nombre")
- print(nombre,"Mejor te llamare humano")
- elif op == "4":
- print("Hasta la próxima")
- else:
- print("Lo opción seleccionada no existe")
Add Comment
Please, Sign In to add comment