Advertisement
teslariu

while2

Apr 21st, 2021
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # programa que pide la edad de una persona y responde su condicion
  5. # frente al voto
  6.  
  7. while True:
  8.  
  9. #################################################    
  10.     edad = int(input("Por favor, ingrese su edad: "))
  11.  
  12.     if 0 < edad < 16:
  13.         print("Voto prohibido")
  14.     elif 16 <= edad < 18 or edad > 70:
  15.         print("Voto optativo")
  16.     elif 18 <= edad < 70:
  17.         print("Voto obligatorio")
  18.     else:
  19.         print("Edad incorrecta")
  20. #######################################################
  21.  
  22.        
  23.     opcion = input("Presione cualquier tecla ('x' para salir): ")
  24.     if opcion == "x":
  25.         print("Gracias por usar este programa....")
  26.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement