Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44855

Re: First python program, syntax error in while loop

Path csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'operator': 0.03; 'affected': 0.07; 'expressions': 0.07; 'exception.': 0.09; 'mixed': 0.09; 'subject:while': 0.09; 'sure,': 0.09; 'python': 0.11; 'jan': 0.12; 'boolean': 0.16; 'formatted': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'here).': 0.16; 'precedence': 0.16; 'reedy': 0.16; 'roy': 0.16; 'subject:program': 0.16; 'subject:python': 0.16; 'language': 0.16; 'wrote:': 0.18; '(but': 0.19; '>>>': 0.22; 'manual': 0.22; "aren't": 0.24; 'tend': 0.24; 'fairly': 0.24; 'chapter': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'too.': 0.31; 'once,': 0.31; 'operations.': 0.31; 'figure': 0.32; 'table': 0.34; 'maybe': 0.34; 'problem': 0.35; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'received:209': 0.37; 'sometimes': 0.38; 'ahead': 0.38; 'ends': 0.38; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'expression': 0.60; 'most': 0.60; 'helps': 0.61; 'line,': 0.68; 'smith': 0.68; 'subject:First': 0.74; '100%': 0.77; 'article': 0.77; '6:11': 0.84; 'actually,': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=OninwU5Dh5KyN++kUVC6Y1y0wZCM5b/OhDbt6eNUwxs=; b=ffKP7gDghtFVvMc/jzpuflKPLDaymwlhvD7UWQ25Cs8xbYshGNfp6MKkZF25rmCB4D bTcvgXeQJt12x/ZXriEYX6h5oBEYR/CjNMEG4gIEw4od4A79j6bjPPsc3MQRhn7Vzz6h puvkfnce430R5FnjGzSPPNeRSbpa8RBVfYKBFWmHZE+ki2qxNBAB4VtANAk2KO1JVnLU BxRRFyexBfdq9+3iwe9fiwdpAy5fmnZiiK5ZpJkG8I0FvXBUZg26FWy3iyp6INwmoAhL ddoszJt/VDD5+Rae9nLXKu39DJp+JE9IDyOoT2wAyOgDWAsfIK/ZgotnfSQi8tH0c7wb 6Faw==
MIME-Version 1.0
X-Received by 10.58.56.161 with SMTP id b1mr7547395veq.42.1367877059875; Mon, 06 May 2013 14:50:59 -0700 (PDT)
In-Reply-To <km92ph$8gs$1@ger.gmane.org>
References <24c5856e-a30a-41bd-aa4a-0e594734e1f8@googlegroups.com> <mailman.1360.1367843880.3114.python-list@python.org> <roy-76F87B.09084406052013@news.panix.com> <mailman.1361.1367847484.3114.python-list@python.org> <km8ida$dgh$1@panix2.panix.com> <km92ph$8gs$1@ger.gmane.org>
Date Tue, 7 May 2013 07:50:59 +1000
Subject Re: First python program, syntax error in while loop
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1387.1367877062.3114.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367877062 news.xs4all.nl 15870 [2001:888:2000:d::a6]:35651
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44855

Show key headers only | View raw


On Tue, May 7, 2013 at 6:11 AM, Terry Jan Reedy <tjreedy@udel.edu> wrote:
> On 5/6/2013 11:31 AM, Roy Smith wrote:
>>
>> In article <mailman.1361.1367847484.3114.python-list@python.org>,
>> Chris Angelico  <rosuav@gmail.com> wrote:
>>> If I ever have even the slightest doubt, I just go ahead and type
>>> "<language> operator precedence" into a web search and check it :)
>>
>>
>> Well, that solves the problem once, and it solves it for me.  I figure
>> if I'm not 100% sure, then maybe other people aren't 100% sure either,
>> and my adding the extra parens helps them too.
>
>
> If you keep the Python docs handy, on or off line, the Language manual
> Expressions chapter ends with this single page (but better formatted as a
> table than here). But I sometimes add parens for quickness or readability.
>
> or Boolean OR
> and Boolean AND

Actually, this is one exception. I tend to parenthesize any case where
there's a complex set of conditions and mixed AND and OR operations.
Part of the reason for this is that any expression that can be
affected by the precedence of and and or will most likely be fairly
long and/or complex anyway, so a few extra parens won't hurt.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

First python program, syntax error in while loop ryankoch38@gmail.com - 2013-05-03 10:18 -0700
  Re: First python program, syntax error in while loop John Gordon <gordon@panix.com> - 2013-05-03 17:27 +0000
  Re: First python program, syntax error in while loop Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-05-03 19:26 +0200
    Re: First python program, syntax error in while loop John Gordon <gordon@panix.com> - 2013-05-03 17:37 +0000
  Re: First python program, syntax error in while loop MRAB <python@mrabarnett.plus.com> - 2013-05-03 18:36 +0100
  Re: First python program, syntax error in while loop Zachary Ware <zachary.ware+pylist@gmail.com> - 2013-05-03 12:37 -0500
  Re: First python program, syntax error in while loop ryankoch38@gmail.com - 2013-05-03 10:57 -0700
    Re: First python program, syntax error in while loop John Gordon <gordon@panix.com> - 2013-05-03 18:21 +0000
      Re: First python program, syntax error in while loop ryankoch38@gmail.com - 2013-05-03 11:34 -0700
  Re: First python program, syntax error in while loop ryankoch38@gmail.com - 2013-05-03 12:52 -0700
    Re: First python program, syntax error in while loop John Gordon <gordon@panix.com> - 2013-05-03 20:04 +0000
  Re: First python program, syntax error in while loop ryankoch38@gmail.com - 2013-05-03 13:15 -0700
    Re: First python program, syntax error in while loop Neil Cerutti <neilc@norwich.edu> - 2013-05-03 20:30 +0000
      Re: First python program, syntax error in while loop John Gordon <gordon@panix.com> - 2013-05-03 20:38 +0000
        Re: First python program, syntax error in while loop Neil Cerutti <neilc@norwich.edu> - 2013-05-06 12:06 +0000
          Re: First python program, syntax error in while loop Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-06 13:37 +0100
            Re: First python program, syntax error in while loop Neil Cerutti <neilc@norwich.edu> - 2013-05-06 13:07 +0000
            Re: First python program, syntax error in while loop Roy Smith <roy@panix.com> - 2013-05-06 09:08 -0400
              Re: First python program, syntax error in while loop rusi <rustompmody@gmail.com> - 2013-05-06 06:36 -0700
              Re: First python program, syntax error in while loop Chris Angelico <rosuav@gmail.com> - 2013-05-06 23:37 +1000
                Re: First python program, syntax error in while loop roy@panix.com (Roy Smith) - 2013-05-06 11:31 -0400
                Re: First python program, syntax error in while loop Terry Jan Reedy <tjreedy@udel.edu> - 2013-05-06 16:11 -0400
                Re: First python program, syntax error in while loop Chris Angelico <rosuav@gmail.com> - 2013-05-07 07:50 +1000
              Re: First python program, syntax error in while loop Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-05-06 20:16 -0400
            Re: First python program, syntax error in while loop alex23 <wuwei23@gmail.com> - 2013-05-06 17:17 -0700
              Re: First python program, syntax error in while loop Roy Smith <roy@panix.com> - 2013-05-06 20:18 -0400
              Re: First python program, syntax error in while loop Dan Sommers <dan@tombstonezero.net> - 2013-05-07 05:03 +0000
              Re: First python program, syntax error in while loop Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-07 07:10 +0100
              Re: First python program, syntax error in while loop Chris Angelico <rosuav@gmail.com> - 2013-05-07 19:19 +1000

csiph-web