Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # Programa que pide una edad y decide la condiciòn frente al voto
- # 1 condicional (if) y 2 bucles (while, for)
- while True:
- #######################################
- edad = int(input("Ingrese su edad: "))
- if 0 < edad < 16:
- print("Voto prohibido")
- elif 16<= edad < 18 or edad >= 70:
- print("Voto optativo")
- elif 18 <= edad < 70:
- print("Voto obligatorio")
- else:
- print("Error en el ingreso de la edad")
- ###########################################
- opcion = input("Presione cualquier tecla para continuar (o 1 para salir): ")
- if opcion == "1":
- print("Gracias por usar este programa...")
- break
Advertisement
Add Comment
Please, Sign In to add comment