Skip to content

Instantly share code, notes, and snippets.

@peroh215
Created November 4, 2018 17:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peroh215/c1ac9898b906ff049b61f0af1893d80e to your computer and use it in GitHub Desktop.
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
#!/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