Created
June 29, 2018 05:34
-
-
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
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
""" | |
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