Re: [Tutor] Guessing program with a twist isn't working

2015-11-18 Thread Alan Gauld
On 17/11/15 18:58, Gavin O'Leary wrote: def ask(x): while True: print "I guess %d" % x answer = raw_input("Is that right, too high, or too low?: ") if answer == 'right': print "Lucky me!" sys.exit(0) elif answer == 'too low':

[Tutor] Guessing program with a twist isn't working

2015-11-18 Thread Gavin O'Leary
Hello all, I have been trying to write a program that has the user think of a number between 1 and 1000, and the computer will guess the number in 10 or less tries. It isn’t working there. Here is my code. import sys high = 1000 low = 0 print "Think of a number between 1 and 1000 but don't t

Re: [Tutor] Guessing program

2005-05-03 Thread Kent Johnson
Feziwe Mpondo wrote: > hello > problem : question says modify a guessing program and to keep track of > how many times the user has entered the password wrong. if it more than > 3 times, print "that must have bin though" A few tips: - Start a new thread for your question, don't add it at the end