I wrote a program which I tested in the IDE of python 3.2, it worked but whenever I open the program directly or run from command prompt, it doesn't run correctly, after the user inputs the correct answer, the program keeps saying try again. here's the program it's in the code snippet area
I tried it in python 3.1 command line and it worked.
Any suggestions, Is this a bug.
There is a bug with python 3.2 and command line output from input()
It put on a '\r' character on input() when run from command line. http://bugs.python.org/issue11272
This will be fix in in 3.3 (r88530) and 3.2 (r88531). Others versions are not affected.
A temporay fix is to use strip()
guess = input('Your guess\n').strip()