0
How to input our values and do odd or even
Need odd or even program which user must provide the value in place of input
3 Respuestas
0
number = user input thingy...
if(number % 2 ==0):
return true
else:
return false:
0
num = input('Please give me a number: ')
while(not num.isdigit()):
num = input('Give me a NUMBER: ')
result = 'even' if int(num) % 2 == 0 else 'odd'
print('It is ' + result + '.')
I corrected a typo.
Thanks Mr. StarLoad.