Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # turing funcion computable (es lo que puede resolver una màquina)
- # a la màquina se la llama computador
- # para resolver toda funcion computable se necesitan 3 op logicas
- # 1 condicional (if/else)y 2 bucles (for y while)
- # condicional: decide entre V y F:
- """
- # script que pide la edad de una persona y responde si es mayor de edad
- edad = int(input("Ingrese la edad: "))
- if edad >= 18:
- print("Es mayor de edad")
- print("Que bueno")
- else:
- print("Aun es menor")
- print("Chau")
- """
- """
- Script que pide la edad de una persona y devuelve su condición frente al
- voto
- si tiene menos de 16 años: voto prohibido
- si tiene 16 años o mas pero menos de 18 : voto optativo
- si tiene 18 años o mas pero menos de 70: voto obligatorio
- si tiene 70 años o mas: voto optativo
- """
- edad = int(input("Ingrese la 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: ¿no ha ingresado un nro negativo?")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement