Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: Wikibooks example doesn't work Date: Thu, 7 Aug 2014 03:18:35 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 41 Message-ID: References: NNTP-Posting-Host: panix3.panix.com X-Trace: reader1.panix.com 1407381515 11024 166.84.1.3 (7 Aug 2014 03:18:35 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 7 Aug 2014 03:18:35 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:75823 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: > print("It's bigger...") > elif guess > number: > print("It's not so big.") > > if count > 3: > print("That must have been complicated.") > else: > print("Good job!") > http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python_3/Decisions > 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. It would help tremendously if you gave us more detail than "it doesn't work". Do you get an error message? Does the program not execute at all? Does it execute, but give unexpected results? -- John Gordon Imagine what it must be like for a real medical doctor to gordon@panix.com watch 'House', or a real serial killer to watch 'Dexter'.