teslariu

plantillas

Sep 30th, 2023
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.01 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. # UNA CADENA ES UNA COLECCION
  5. # TODA COLECCION ES ITERABLE
  6. '''
  7. #### PLANTILLA While True de una opcion #################
  8.  
  9. # Script que pide la edad y devuelve si es mayor o no
  10. while True:
  11.    
  12.     ###### inicio  script  ############
  13.    
  14.     edad = int(input('Ingrese su edad: '))
  15.  
  16.     if edad < 18:
  17.         print("Es menor de edad")
  18.         print("lastima...")
  19.     else:
  20.         print("Es mayor de edad")
  21.         print("Albricias...")
  22.  
  23.     ####   fin script ###############
  24.    
  25.     opcion = input("Presione cualquier tecla para continuar ('X' para salir): ")
  26.     if opcion.lower() == "x":
  27.         print("Gracias por utilizar este programa...")
  28.         break
  29.  
  30. '''
  31. # Plantilla While True con menu
  32.  
  33. menu = """
  34. Calculadora
  35. 1. Suma
  36. 2. Multiplicacion
  37. 3. Salir
  38. """
  39.  
  40. while True:
  41.     print(menu)
  42.     opcion = input("Seleccione una opcion: ")
  43.    
  44.     if opcion == "1":
  45.         pass
  46.        
  47.     elif opcion == "2":
  48.         pass
  49.        
  50.     elif opcion == "3":
  51.         print("Adios...")
  52.         break
  53.        
  54.     else:
  55.         print("opcion incorrecta...")
  56.    
  57.    
  58.    
  59.  
  60.  
  61.  
  62.  
  63.  
Add Comment
Please, Sign In to add comment