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.

Re: Python Program not running correctly in python 3.2 commnad line 80 80

That mean you got a logic error. check your while and if loops well.

Re: Python Program not running correctly in python 3.2 commnad line 80 80

I'll check it out. But it did run fine in the IDLE. :)
Thanks all the same.

Re: Python Program not running correctly in python 3.2 commnad line 80 80

Works for me using Python 3.2 (r32:88452, Feb 20 2011, 11:12:31)

You have misspelled Torvalds, however.

Re: Python Program not running correctly in python 3.2 commnad line 80 80

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()

Re: Python Program not running correctly in python 3.2 commnad line 80 80

Thanks for that, i will try and use the .strip()
Thanks to all that posted in this thread.
:)
I've have corrected the spelling in the edited version of the program thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.