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


Groups > comp.lang.python > #43173

Re: While loop help

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'syntax': 0.04; 'elif': 0.05; 'subject:help': 0.08; 'forcing': 0.09; 'interpreted': 0.09; 'occasionally': 0.09; 'parsed': 0.09; 'statements': 0.09; 'ah!': 0.16; 'before.': 0.16; 'cause.': 0.16; 'expression,': 0.16; 'expression.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'pointed': 0.19; 'properly': 0.19; 'later': 0.20; 'work,': 0.20; 'now?': 0.24; 'header:In- Reply-To:1': 0.27; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'getting': 0.31; 'file': 0.32; 'probably': 0.32; 'quite': 0.32; 'open': 0.33; 'actual': 0.34; 'problem': 0.35; "can't": 0.35; 'received:209.85': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'next': 0.36; 'received:209': 0.37; 'sometimes': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; 'previous': 0.38; 'delete': 0.39; 'to:addr:python.org': 0.39; "you're": 0.61; 'guarantee': 0.63; 'close': 0.67; 'invalid': 0.68; 'line,': 0.68; 'moves': 0.84; 'relating': 0.93; '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=L68X6r3z4uR9i3xvlHl4q85X8/rqNcewDS3N4Db2oS4=; b=FC6mWPJpVreSsEPj4llXnvY2TXvglaIhdJrfRXxW7Yz/kGNE9m5fgIX6Xk+O/AAvz3 btXrq229ZSYxQziTuaiq9eBOMregxQqsr2XHLIKWpehyXG93SmxMd/BR61tvswnTsnRG nW+6+/mTV06kN3E04FbihOX+kA7RXQBfZU3yBbzg7mBWUxiwPg5sLvm2EWBeRkQDXVPI ChPwhdtnnzUH93KNjvlIZ8PRhMR68dcJgY7b8cHlta5KzachG2r7GiW9n1ciHc6y7T0m 1r6e/WFhfhIQRvdaOaCzfl6vjKQyNjx7QPY2UxsRvwNtiSQhgSm1n5Q6r7e1DENfmgnm /ceg==
MIME-Version 1.0
X-Received by 10.52.91.71 with SMTP id cc7mr1625418vdb.58.1365516325487; Tue, 09 Apr 2013 07:05:25 -0700 (PDT)
In-Reply-To <596ca4b8-b5aa-4112-b086-6320108075f7@googlegroups.com>
References <b93147e7-9d17-4232-99a3-767b88f9e9ba@googlegroups.com> <596ca4b8-b5aa-4112-b086-6320108075f7@googlegroups.com>
Date Wed, 10 Apr 2013 00:05:25 +1000
Subject Re: While loop help
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.348.1365516328.3114.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1365516328 news.xs4all.nl 6978 [2001:888:2000:d::a6]:38648
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:43173

Show key headers only | View raw


On Tue, Apr 9, 2013 at 11:58 PM,  <thomasancilleri@gmail.com> wrote:
> Also I'm getting a invalid syntax next to my elif statements that i wasnt getting before. why is this happening now?

Ah! That's relating to the close parenthesis problem I mentioned.
That's the exact issue I saw.

When you get told about a problem, sometimes the location pointed out
isn't the actual cause. What you have is a (near) guarantee that the
problem is no later in the file than that point; often it'll be on
that line or the one previous line. In this case, the code is
"raw_input(........ elif", which can't be properly parsed - the open
parenthesis is forcing the code to be interpreted as an expression,
and elif isn't an expression.

If you're stuck figuring out a problem, one neat trick is to delete
the line of code that's blamed for the problem and try again. If the
problem disappears, it was on that line; if the problem moves down to
the next line, it's probably on the preceding line. This trick doesn't
always work, but it can occasionally be quite handy.

ChrisA

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


Thread

While loop help thomasancilleri@gmail.com - 2013-04-09 06:32 -0700
  Re: While loop help thomasancilleri@gmail.com - 2013-04-09 06:57 -0700
    Re: While loop help Dave Angel <davea@davea.name> - 2013-04-09 13:12 -0400
      Re: While loop help thomasancilleri@gmail.com - 2013-04-09 10:18 -0700
        Re: While loop help Chris Angelico <rosuav@gmail.com> - 2013-04-10 03:23 +1000
        Re: While loop help Dave Angel <davea@davea.name> - 2013-04-09 13:30 -0400
  Re: While loop help thomasancilleri@gmail.com - 2013-04-09 06:58 -0700
    Re: While loop help Chris Angelico <rosuav@gmail.com> - 2013-04-10 00:05 +1000
      Re: While loop help thomasancilleri@gmail.com - 2013-04-09 08:47 -0700
        Re: While loop help Joel Goldstick <joel.goldstick@gmail.com> - 2013-04-09 12:02 -0400
        Re: While loop help Chris Angelico <rosuav@gmail.com> - 2013-04-10 02:10 +1000
          Re: While loop help thomasancilleri@gmail.com - 2013-04-09 09:24 -0700
            Re: While loop help Joel Goldstick <joel.goldstick@gmail.com> - 2013-04-09 12:36 -0400
            Re: While loop help Chris Angelico <rosuav@gmail.com> - 2013-04-10 02:47 +1000
              Re: While loop help thomasancilleri@gmail.com - 2013-04-09 09:57 -0700
                Re: While loop help Chris Angelico <rosuav@gmail.com> - 2013-04-10 03:08 +1000
                Re: While loop help Dave Angel <davea@davea.name> - 2013-04-09 13:27 -0400
              Re: While loop help thomasancilleri@gmail.com - 2013-04-09 09:57 -0700
          Re: While loop help thomasancilleri@gmail.com - 2013-04-09 09:24 -0700
          Re: While loop help Walter Hurry <walterhurry@lavabit.com> - 2013-04-09 19:35 +0000
            Re: While loop help Dave Angel <davea@davea.name> - 2013-04-09 16:12 -0400
              Re: While loop help Walter Hurry <walterhurry@lavabit.com> - 2013-04-09 20:59 +0000
                Re: While loop help Chris Angelico <rosuav@gmail.com> - 2013-04-10 08:36 +1000
        Re: While loop help rusi <rustompmody@gmail.com> - 2013-04-10 08:59 -0700
      Re: While loop help thomasancilleri@gmail.com - 2013-04-09 08:47 -0700
  Re: While loop help Chris Angelico <rosuav@gmail.com> - 2013-04-10 00:00 +1000
  Re: While loop help thomasancilleri@gmail.com - 2013-04-09 09:49 -0700
    Re: While loop help Larry Hudson <orgnut@yahoo.com> - 2013-04-09 23:44 -0700
      Re: While loop help Larry Hudson <orgnut@yahoo.com> - 2013-04-10 20:00 -0700
  Re: While loop help jmfauth <wxjmfauth@gmail.com> - 2013-04-09 12:19 -0700

csiph-web