19 lines
350 B
Python
19 lines
350 B
Python
#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!")
|