cis_projects/ps1_2_joseph_green.py

20 lines
351 B
Python
Raw Normal View History

2017-02-11 01:21:04 -07:00
#ask user for a number
#report even or odd
number = None
result = None
evenOdd = None
try:
number = int(input("Please enter a number: "))
result = number % 2
if result == 0:
evenOdd = "even"
else:
evenOdd = "odd"
print(str(number) + ",is an " + evenOdd + " number")
except:
print("Only enter an integers!")