Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- # UNA CADENA ES UNA COLECCION
- # TODA COLECCION ES ITERABLE
- '''
- #### PLANTILLA While True de una opcion #################
- # Script que pide la edad y devuelve si es mayor o no
- while True:
- ###### inicio script ############
- edad = int(input('Ingrese su edad: '))
- if edad < 18:
- print("Es menor de edad")
- print("lastima...")
- else:
- print("Es mayor de edad")
- print("Albricias...")
- #### fin script ###############
- opcion = input("Presione cualquier tecla para continuar ('X' para salir): ")
- if opcion.lower() == "x":
- print("Gracias por utilizar este programa...")
- break
- '''
- # Plantilla While True con menu
- menu = """
- Calculadora
- 1. Suma
- 2. Multiplicacion
- 3. Salir
- """
- while True:
- print(menu)
- opcion = input("Seleccione una opcion: ")
- if opcion == "1":
- pass
- elif opcion == "2":
- pass
- elif opcion == "3":
- print("Adios...")
- break
- else:
- print("opcion incorrecta...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement