John Machin wrote: > Nathan Pinno wrote: >> guess = input("Guess a number: ") > > > "guess" will refer to a string e.g. "42" which will *not* compare equal > to the integer 42. Also you should use raw_input, not input. > > so do this: > > guess = int(raw_input("Guess a number: ")) >
Ahem ... I'll redo that: You'd be better using raw_input, which *then* means you need to wrap int() around it, ending up with the same recommendation: guess = int(raw_input("Guess a number: ")) Cheers, John -- http://mail.python.org/mailman/listinfo/python-list