Re: Newbie: Explain My Problem

2005-06-29 Thread Robert Kern
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

Re: Newbie: Explain My Problem

2005-06-29 Thread John Machin
[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

Re: Newbie: Explain My Problem

2005-06-29 Thread Roel Schroeven
[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

Re: Newbie: Explain My Problem

2005-06-29 Thread Brian van den Broek
[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

Re: Newbie: Explain My Problem

2005-06-29 Thread rjreeves
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

Re: Newbie: Explain My Problem

2005-06-29 Thread rjreeves
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

Newbie: Explain My Problem

2005-06-29 Thread ChuckDubya
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: