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: Maggical1 AT netscape.net
  • To: byte-of-python AT lists.ibiblio.org ("Discussion regarding the book 'A Byte of Python'")
  • Subject: Re: [Byte-of-Python] Continue statement
  • Date: Fri, 05 Aug 2005 15:19:59 -0400

Thanks Juan and others. I must have had gremlins doing their thing yesterday,
because as you've stated, it works fine.

Sorry to waste fellow pythonians time.

Gary

"沈洁元" <orion_val AT 163.com> wrote:

>Gary,
>    I've tested your example.  And it works well as it expects.  If I input
> 'he' -- a less-than-3-characters string, 'first statement...' and 'second
> statement...' is printed, and 'Input is of sufficient length' won't be
> output.
>
>                                                      Juan Shen
>
>> 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
>>
>> Gary
>

__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp




Archive powered by MHonArc 2.6.24.

Top of Page