Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- # maquina de turing puede calcular funciones computables
- # toda funcion computable puede escribir con 1 condicional y 2 bucles
- # python : 1 condicional if-else 2 bucles for, while
- """
- Script que pide ingreso de una edad por pantalla y devuelve su condición
- al voto
- Ej: menos de 16 años: prohibido votar
- 16 y menos de 18: optativo
- 18 y menos de 70: obligatorio
- 70 o mas: optativo
- """
- edad = int(input("Ingrese la edad: "))
- if 0 < edad < 16:
- print("Voto prohibido")
- print("Que mala suerte...")
- elif 16 <= edad <18 or edad >= 70:
- print("Voto optativo")
- elif 18 <= edad < 70:
- print("Voto obligatorio")
- else:
- print("Error de ingreso de edad")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement