Skip to Content.
Sympa Menu

byte-of-python - Re: [Byte-of-Python] Continue statement

byte-of-python AT lists.ibiblio.org

Subject: Discussion regarding the book 'A Byte of Python'

List archive

Chronological Thread  
  • From: Dave Pawson <davep AT dpawson.co.uk>
  • To: Discussion regarding the book 'A Byte of Python' <byte-of-python AT lists.ibiblio.org>
  • Subject: Re: [Byte-of-Python] Continue statement
  • Date: Thu, 04 Aug 2005 19:25:35 +0100

On Thu, 2005-08-04 at 13:02 -0400, Maggical1 AT netscape.net wrote:
> In working thru the examples, there are 2 things I don't understand
> regarding the continue example in chapter 6.
> 1. If I put print statements before the continue, no output is produced.
> Example:
> while True:
> s = raw_input('Enter something : ')
> if s == 'quit':
> break
> if len(s) < 3:
> print 'first statement before continue'
> print 'second statement before continue'
> continue
> print 'Input is of sufficient length'
> 2. As the example is shown, it doesn't matter what size string is input,
> the script will always output "Input is of sufficent length", as long as
> the string isn't quit.
>
> Thank you in advance for any help or comments in clarifying this for me

I guess it's called a bad example?

Agree, it needs changing.

regards DaveP





Archive powered by MHonArc 2.6.24.

Top of Page