Is there a way to accept only numbers in Python, say like using raw_input()?
I know I can always get the input and catch a ValueError exception, but I was interested in knowing whether there was someway I could force the prompt to accept only numbers and freeze on any other input.
From the docs:
Using this, you could grab the character, check if it’s a number, and then display it. I haven’t tried it myself, though.