PDA

View Full Version : [Python] User Input



swatto
September 8th, 2008, 12:34 PM
Hi all,

Could someone tell me how I can make sure that the user only enters an integer at input please - im trying to find this out and think I have to use input() instead of raw_input()??

Could it be checked directly at input or would the user have to enter something, it then be checked by an IF statement and then ask again if it's not an Integer?

Thanks for any help.

Def13b
September 8th, 2008, 12:42 PM
You might want to have a read of this thread from earlier today.

http://ubuntuforums.org/showthread.php?t=913421

swatto
September 8th, 2008, 12:45 PM
You might want to have a read of this thread from earlier today.

http://ubuntuforums.org/showthread.php?t=913421

Thanks alot :)