Skip to content

Instantly share code, notes, and snippets.

@chookity-pokk
Created June 29, 2018 05:34
Show Gist options
  • Save chookity-pokk/3ecf603fc7acd86d97e2340c1b5d67d7 to your computer and use it in GitHub Desktop.
Save chookity-pokk/3ecf603fc7acd86d97e2340c1b5d67d7 to your computer and use it in GitHub Desktop.
Python program that tells you if your inputted number is odd or even
"""
Python program that tells me if a number is odd or even
Hank Greenburg
Date: 6/28/2018
"""
num = input("Pick a number, any number:\n")
if num % 2 == 0:
print("Your number is even.")
else:
print("Your number is odd.")
#Above is my code and below is the exact solution
num = input("Enter a number: ")
mod = num % 2
if mod > 0:
print("You picked an odd number.")
else:
print("You picked an even number.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment