Created
June 5, 2016 21:21
-
-
Save ghughes13/618bf98f9203d37c628b45e98594b832 to your computer and use it in GitHub Desktop.
Determines if a number is even or odd. Can Also determine if a number is divisible by another.
This file contains 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 = raw_input("Enter a number: ") | |
number = int(number) | |
def evenOdd(number): | |
if number % 4 == 0: | |
print "It's an even number AND a multiple of 4!" | |
elif number % 2 == 0: | |
print "It's an even number!" | |
else: | |
print "It's an odd number!" | |
evenOdd(number) | |
numA = raw_input("Want to find if a number is divisivle by another? Enter one: ") | |
numB = raw_input("Now enter another: ") | |
def divisible(a,b): | |
if int(a) % int(b) == 0: | |
print "The first number is divisible by the second" | |
else: | |
print "The first number is not divisible by the second" | |
divisible(numA,numB) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment