Created
May 12, 2017 07:19
-
-
Save odanga94/a146859463020ef1599f4ff6d6586c80 to your computer and use it in GitHub Desktop.
PythonPractice/Exercise2.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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