Advertisement
teslariu

IF VOTO

Jun 9th, 2021
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Script que pide la edad de una persona y responde diciendo su
  5. # condicion frente al voto
  6. # si es menor de 16: voto prohibido
  7. # si tiene 16 o mas y menos de 18: voto optativo
  8. # si tiene 18 o más y menos de 70: voto obligatorio
  9. # si tiene 70 o más: voto optativo
  10.  
  11. edad = int(input("Por favor, ingrese su edad: "))
  12.  
  13.  
  14. if 0 < edad < 16:
  15.     print("Voto prohibido")
  16.    
  17. elif 16<= edad < 18 or edad >= 70:
  18.     print("Voto optativo")
  19.    
  20. elif 18 <= edad < 70:
  21.     print("Voto obligatorio")
  22.    
  23. else:
  24.     print("Error en el ingreso de la edad")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement