Skip to content

Instantly share code, notes, and snippets.

@odanga94
Created May 12, 2017 07:19
Show Gist options
  • Save odanga94/a146859463020ef1599f4ff6d6586c80 to your computer and use it in GitHub Desktop.
Save odanga94/a146859463020ef1599f4ff6d6586c80 to your computer and use it in GitHub Desktop.
PythonPractice/Exercise2.py
number = int(input("Enter a number:"))
if number % 2 == 0 and number % 4 == 0:
print("%d is a multiple of both 2 and 4") % number
elif number % 2 == 0:
print("%d is an even number") % number
else:
print("%d is an odd number") % number
def num_check():
num = int(input("Enter the number to be divided into:"))
check = int(input("Enter the divisor:"))
if num % check == 0:
print("%d divides evenly into %d") %(check, num)
else:
print("%d is not a multiple of %d") %(num, check)
num_check()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment