- #1
GreenPrint
- 1,196
- 0
Homework Statement
I was wondering if anyone knows of a conditional statement that will prevent users from imputing non integer inputs.
like for example
z=0
while z<1
x=input('Enter Something')
if SOME MAGICAL CONDITIONAL STATEMENT
disp('You entered a invalid entry. Please try again.')
else
z=1;
end
end
I hope you get what I'm trying to do. In a loop prompt a user to enter a number. If the user enters a number like 5.5 I would like the message to come up 'You entered a invalid entry. Please try again.' by using some conditional statement
anyone got any ideas?