John Machin wrote:
> [EMAIL PROTECTED] wrote:
> [snip]
>
>>while counter != 0:
>>if guess == num:
>
> [snip]
>
> Others have told you already what was wrong with your program. Here's a
> clue on how you could possibly help yourself:
>
> 1. Each time around your loop, print the values of th
[EMAIL PROTECTED] wrote:
[snip]
> while counter != 0:
> if guess == num:
[snip]
Others have told you already what was wrong with your program. Here's a
clue on how you could possibly help yourself:
1. Each time around your loop, print the values of the interesting
objects, in this case coun
[EMAIL PROTECTED] wrote:
> Code:
>
[snip]
> else:
> counter = counter - 1
> print
> print "The number is greater than your guess."
> print "You have", counter, " chances left to guess the number."
> guess = (raw_input("Your guess is "))
The above line
[EMAIL PROTECTED] said unto the world upon 29/06/2005 03:11:
> Code:
>
> #The Guess My Number Game
>
> import random
> num = ""
> guess = ""
> counter = 7
> num = random.randrange(1, 100)
> print "I'm thinking of a whole number from 1 to 100."
> print "You have ", counter, " chances left to guess
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 "Y
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 "Y
Code:
#The Guess My Number Game
import random
num = ""
guess = ""
counter = 7
num = random.randrange(1, 100)
print "I'm thinking of a whole number from 1 to 100."
print "You have ", counter, " chances left to guess the number."
print
guess = int(raw_input("Your guess is: "))
while counter != 0: