Skip to content

Instantly share code, notes, and snippets.

@ALXTorresC
Created January 13, 2018 13:25
Show Gist options
  • Save ALXTorresC/8ae17edb54498d93598a66efdae0aa83 to your computer and use it in GitHub Desktop.
Save ALXTorresC/8ae17edb54498d93598a66efdae0aa83 to your computer and use it in GitHub Desktop.
Solution to exercise 02
## Code for exercise 002
#-*- coding: utf-8 -*-
pattern = 2
print("Par o impar\n---------")
number = int(input("Ingrese un número: "))
message = "par" if (number % pattern == 0) else "impar"
pattern = 4
by_four = "Ademas su número es divisor de 4" if (number % pattern == 0) else ""
print("Haz ingresado un número " +message+". "+by_four)
## Code for exercise 002 point 2
#-*- coding: utf-8 -*-
num = int(input("Ingrese un número: "))
check = int(input("Ingrese el número de comprobación: "))
validator = True if(num % check == 0) else False
if validator:
print("El número ingresado es divisible por el número de comprobación.")
else:
print("El número ingresado NO es divisible por el número de comprobació$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment