Newbie: Explain My Problem
rjreeves
robert at reeves.net
Wed Jun 29 03:59:33 EDT 2005
Hi Chuck
1. Missing an int(.. on one of the guess=
print "You have", counter, " chances left to guess the number."
guess = int(raw_input("Your guess is "))
Thus ensuring guess is consistent with it content type
2. Need a break when the guess=num
if guess == num:
print "You guessed the number, ", num, " in ", counter-6, "
guesses!"
break
To stop from looping in the while when counter is NOT zero but the
number has been found.
More information about the Python-list
mailing list