Created
November 4, 2018 17:36
-
-
Save peroh215/c1ac9898b906ff049b61f0af1893d80e to your computer and use it in GitHub Desktop.
Program that checks if a number (inputted by the user) is even or odd
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
#!/usr/bin/env python | |
#Author: Blackman White | |
#Description: Program that checks if a number (inputted by the user) is even or odd | |
def check_even(num): | |
hnum = int(num / 2) | |
if hnum * 2 != num: | |
print("Number is odd") | |
else: | |
print("number is even") | |
print("----- EVEN NUMBER CHECKER -----") | |
prompt = float(input("Enter a number: ")) | |
check_even(prompt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment