Odd or even finder doubt (Python 2.7)
What I'm trying to do in this programme is to find whether the number that the user has entered is odd or even.
While trying to do this, I have come across an obstacle that was brought to my attention by my coding teacher.
He asked me what would happen if the user enters a string or a float value. Ever since then, I'm trying to make this work but nothing seems to be happening.
Someone, please tell me what I'm doing wrong.
Line 3: (Get user input): You must convert it to a float or int using
Line 4: (Test if number is whole number): Required only if you use
float() on line 3
if number == int(number): print('This is a whole number') else: print('This is not a whole number')
Line 6, Line 13: (Testing even or odd): Change
remainder (You're testing the wrong value)