Possible Duplicate:
Python – How to check if input is a number (given that input always returns strings)
I need to check a input and send a error message if it’s not numerical. How would i do this the best way? Cant seem to find any other posts about it thou i’m shure someone must have asked this question before.
@TokenMacGuy’s solution is better if you’re getting your input from
raw_input(), but otherwise this works.If you want to loop until you get proper input rather than raise an error, try this: