[Tutor] guess age programme (still stuck!!!!!)

Alan Gauld alan.gauld at btinternet.com
Sat Oct 1 01:19:53 CEST 2011


On 30/09/11 21:21, Dave Angel wrote:

>> print "\n\nGood guess!!"
>> input ("\n\nPress the enter key to exit.")
>
> input() returns a character string.

Given the OP's print style I assume he is running Python v2 so input() 
will evaluate a number as an int. But given that using input()  is 
usually frowned on it would probably be better to convert the input() 
calls to raw_input() and then convert to int with int()

To the OP. You don't actually tell us what is going wrong with
your program. How is it failing? Does it just loop forever or
is it giving the wrong messages? When you say you are "still stuck" what 
exactly is happening?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list