Re: Wikibooks example doesn't work

2014-08-07 Thread Seymore4Head
00, Seymore4Head >>>> wrote: >>>> > >[snip] >>> Ah, now things make sense! Your subject line is misleading! It's not that >>> the wikibooks example doesn't work, the example works fine. It's that the >>> code you added to it d

Re: Wikibooks example doesn't work

2014-08-06 Thread Ben Finney
Larry Hudson writes: > I just took a look at that web page, and I see what your problem > actually is... > You are misunderstanding the problem. The problem does NOT say to end > the loop at three tries, just to keep track of the number of tries. > It's not actually specific, but the implication

Re: Wikibooks example doesn't work

2014-08-06 Thread Larry Hudson
On 08/06/2014 08:48 PM, Seymore4Head wrote: On Thu, 07 Aug 2014 13:43:40 +1000, Steven D'Aprano wrote: Seymore4Head wrote: On Wed, 06 Aug 2014 22:58:51 -0400, Seymore4Head wrote: [snip] Ah, now things make sense! Your subject line is misleading! It's not that the wikiboo

Re: Wikibooks example doesn't work

2014-08-06 Thread alex23
On 7/08/2014 1:25 PM, Seymore4Head wrote: This part was added as an exercise. A counter is added to give 3 tries to guess the number. It is supposed to stop after count gets to 3. It doesn't. It just keeps looping back and asking for another guess. You've misread the exercise: Modify the hig

Re: Wikibooks example doesn't work

2014-08-06 Thread Seymore4Head
print("It's bigger...") >>>elif guess > number: >>>print("It's not so big.") >> >> The part to here is supposed to be an example to allow the user to >> guess at a number (7) with an infinite amount of tries. >

Re: Wikibooks example doesn't work

2014-08-06 Thread Steven D'Aprano
") > > The part to here is supposed to be an example to allow the user to > guess at a number (7) with an infinite amount of tries. > > > This part was added as an exercise. Ah, now things make sense! Your subject line is misleading! It's not that the wikibooks example d

Re: Wikibooks example doesn't work

2014-08-06 Thread Steven D'Aprano
Seymore4Head wrote: [snip code that looks fine to me] > Why not? I don't know. What does "doesn't work" mean? "It didn't do what I expected." (What did you expect? What did it do?) "It printed an error message." (Care to tell it what it was?) "It crashed the computer." (Some more details migh

Re: Wikibooks example doesn't work

2014-08-06 Thread Seymore4Head
On Wed, 06 Aug 2014 22:58:51 -0400, Seymore4Head wrote: >number = 7 >guess = -1 >count = 0 > >print("Guess the number!") >while guess != number: >guess = int(input("Is it... ")) >count = count + 1 >if guess == number: >print("Hooray! You guessed it right!") >elif guess <

Re: Wikibooks example doesn't work

2014-08-06 Thread John Gordon
In Seymore4Head writes: > number = 7 > guess = -1 > count = 0 > > print("Guess the number!") > while guess != number: > guess = int(input("Is it... ")) > count = count + 1 > if guess == number: > print("Hooray! You guessed it right!") > elif guess < number: > p

Re: Wikibooks example doesn't work

2014-08-06 Thread Chris Angelico
On Thu, Aug 7, 2014 at 12:58 PM, Seymore4Head wrote: > Why not? > I think I know why it isn't working, but I don't know enough yet on > how it should work. > The If statement isn't getting read. One thing you need to learn about Python... or, for that matter, pretty much any language. "It isn't w

Wikibooks example doesn't work

2014-08-06 Thread Seymore4Head
number = 7 guess = -1 count = 0 print("Guess the number!") while guess != number: guess = int(input("Is it... ")) count = count + 1 if guess == number: print("Hooray! You guessed it right!") elif guess < number: print("It's bigger...") elif guess > number: