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


Groups > comp.lang.python > #74400

Re: Newbie: unexpected indenting error

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
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; 'from:addr:yahoo.co.uk': 0.04; 'elif': 0.05; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'martin': 0.11; 'def': 0.12; 'language.': 0.14; '"unexpected': 0.16; 'accepts': 0.16; 'calculator': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'language': 0.16; 'wrote:': 0.18; 'coding': 0.22; 'header:User-Agent:1': 0.23; '---': 0.24; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'editor': 0.35; 'but': 0.35; 'doing': 0.36; 'too': 0.37; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'space': 0.40; 'free': 0.61; 'gone': 0.61; 'viruses': 0.61; 'first': 0.61; "you've": 0.63; 'protection': 0.63; 'our': 0.64; 'within': 0.65; 'antivirus': 0.68; 'rating': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Newbie: unexpected indenting error
Date Sun, 13 Jul 2014 10:01:23 +0100
References <CAHXoDSDuKsqJ7ceXoUXA3g5K9J0UNRJ7g29uJMPxZEqHQCaCnA@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-78-147-185-26.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To <CAHXoDSDuKsqJ7ceXoUXA3g5K9J0UNRJ7g29uJMPxZEqHQCaCnA@mail.gmail.com>
X-Antivirus avast! (VPS 140713-0, 13/07/2014), Outbound message
X-Antivirus-Status Clean
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.11787.1405242063.18130.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1405242063 news.xs4all.nl 2942 [2001:888:2000:d::a6]:55858
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:74400

Show key headers only | View raw


On 13/07/2014 08:01, Martin S wrote:
> While coding a rating calculator I am using a for-loop within if-elif-else.
> When using the for-loop in the first if instance my editor accepts
> this, but when using the same for-loop within the elif instance it
> complain about "unexpected indent".
>
> Like so:
>
> def function(x):
>     if rdiff >=500:
>        for ....
>           [do stuff]
>     elif rdiff >=410:
>         for ...                      <== unexpected indent
>            [do other stuff]
>
>
> What the...? What am I doing wrong?
> (hopefully the indents translate; else def, if/elif, for and [dostuff]
> are indented)
>
> /Martin S
>

You've gone A Space Too Far.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

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


Thread

Re: Newbie: unexpected indenting error Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-13 10:01 +0100

csiph-web