Advertisement
teslariu

if

Sep 25th, 2021
133
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. # maquina de turing puede calcular funciones computables
  4. # toda funcion computable puede escribir con 1 condicional y 2 bucles
  5. # python : 1 condicional if-else 2 bucles for, while
  6.  
  7.  
  8.  
  9. """
  10. Script que pide ingreso de una edad por pantalla y devuelve su condición
  11. al voto
  12. Ej: menos de 16 años: prohibido votar
  13.  16 y menos de 18: optativo
  14.  18 y menos de 70: obligatorio
  15.  70 o mas: optativo
  16. """
  17. edad = int(input("Ingrese la edad: "))
  18. if 0 < edad < 16:
  19.     print("Voto prohibido")
  20.     print("Que mala suerte...")
  21. elif 16 <= edad <18  or edad >= 70:
  22.     print("Voto optativo")
  23. elif 18 <= edad < 70:
  24.     print("Voto obligatorio")
  25. else:
  26.     print("Error de ingreso de edad")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement