Skip to content

Instantly share code, notes, and snippets.

@ghughes13
Created June 5, 2016 21:21
Show Gist options
  • Save ghughes13/618bf98f9203d37c628b45e98594b832 to your computer and use it in GitHub Desktop.
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.
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