Advertisement
teslariu

ejemplo

Jun 8th, 2021
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. print("Programa que determina la condición frente al voto")
  5.  
  6. while True:
  7.    
  8.     print(
  9.  
  10.         """
  11.        Menu de opciones:
  12.        -----------------
  13.        1. Ingresar edad
  14.        2. Salir
  15.        
  16.        """)
  17.     opcion = input("Por favor, ingrese una opción: ")
  18.    
  19.     if opcion == "1":
  20.         edad = int(input("Por favor, ingrese su edad: "))
  21.  
  22.         if 0 < edad < 16:
  23.             print("Voto prohibido")
  24.  
  25.         elif 16 <= edad < 18 or edad >= 70:
  26.             print("Voto optativo")
  27.    
  28.         elif 18 <= edad < 70:
  29.             print("Voto obligatorio")
  30.    
  31.         else:
  32.             print("error en el ingreso de la edad")
  33.    
  34.     elif opcion == "2":
  35.         print("Gracias por usar este programa...")
  36.         break
  37.        
  38.     else:
  39.         print("Opción incorrecta")
  40.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement