Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #75831
| From | alex23 <wuwei23@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Wikibooks example doesn't work |
| Date | 2014-08-07 14:09 +1000 |
| Organization | A noiseless patient Spider |
| Message-ID | <lruu5s$91m$1@dont-email.me> (permalink) |
| References | <ilq5u9lfopj0g8227i5ko9s0lhn1ppcacm@4ax.com> <r7s5u913pkc0ja59tko4ucravsliljkach@4ax.com> |
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 higher or lower program from this section to keep track of how many times the user has entered the wrong number. If it is more than 3 times, print "That must have been complicated." at the end, otherwise print "Good job!" There's nothing there about breaking out of the loop after 3 attempts, just producing a different end message on successful completion based on how many attempts were made. The Wikibooks example works as specified.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Wikibooks example doesn't work Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-06 22:58 -0400
Re: Wikibooks example doesn't work Chris Angelico <rosuav@gmail.com> - 2014-08-07 13:11 +1000
Re: Wikibooks example doesn't work John Gordon <gordon@panix.com> - 2014-08-07 03:18 +0000
Re: Wikibooks example doesn't work Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-06 23:25 -0400
Re: Wikibooks example doesn't work Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-07 13:43 +1000
Re: Wikibooks example doesn't work Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-06 23:48 -0400
Re: Wikibooks example doesn't work Larry Hudson <orgnut@yahoo.com> - 2014-08-06 21:59 -0700
Re: Wikibooks example doesn't work Ben Finney <ben+python@benfinney.id.au> - 2014-08-07 15:06 +1000
Re: Wikibooks example doesn't work Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-07 11:11 -0400
Re: Wikibooks example doesn't work alex23 <wuwei23@gmail.com> - 2014-08-07 14:09 +1000
RE: Wikibooks example doesn't work8 Andrew Christianson <Andrew.Christianson@Ipsos.com> - 2014-08-07 03:43 +0000
Re: Wikibooks example doesn't work Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-07 13:31 +1000
csiph-web