Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: IdentationError; unexpected indent Date: Wed, 13 Apr 2016 10:05:50 -0600 Lines: 28 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 00GVQGAHX410zVFwhd1P6w7G7ex4XSqWwjGhCvcErSZg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'lines.': 0.07; 'posted.': 0.09; 'unexpected': 0.09; 'python': 0.10; 'wed,': 0.15; '2016': 0.16; 'dist': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'traceback.': 0.16; 'wrote:': 0.16; 'tells': 0.18; 'all,': 0.20; 'changes': 0.20; '(see': 0.20; 'occurs': 0.22; 'please?': 0.22; 'trying': 0.22; 'am,': 0.23; 'appears': 0.23; 'code,': 0.23; 'header:In-Reply-To:1': 0.24; 'appear': 0.26; 'error': 0.27; 'message-id:@mail.gmail.com': 0.27; 'executing': 0.27; 'said,': 0.27; 'correct': 0.28; 'skip:( 20': 0.28; '13,': 0.29; 'indentation': 0.29; 'second,': 0.29; 'there.': 0.30; 'print': 0.30; 'code': 0.30; 'post': 0.31; "can't": 0.32; 'run': 0.33; 'problem': 0.33; 'message.': 0.33; 'skip:d 20': 0.34; 'received:google.com': 0.35; 'on,': 0.35; 'next': 0.35; 'but': 0.36; 'should': 0.36; 'lines': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'skip:p 20': 0.38; 'hi,': 0.38; "didn't": 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'entire': 0.61; 'intent': 0.66; '2.7.': 0.84; 'doubts': 0.84; 'edge,': 0.84; 'post,': 0.84; 'to:name:python': 0.84; 'subject:; ': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=RIVCX+XUYs7tHWDDLwkfAWlRNAdgWRkqf02BdqfHzz4=; b=oXYOtZ9XFmJqVDdPSJbSLK6QsuHvWoRyfTqMxRx7qR6W1uTF0AqI6YAj+pXW9SD0Ao l6GgqEc3DJdzyrp/haAh2zituqdTcHq0MdV0XMDoxxI98DD3H4+qqMwW2LoLJ6OwzNJ0 dz4xCG68NMibHQn+NtjT4/x2QYvBpEkulb5ubG4BQJBU44bBk2K9UGFrUmfJXnbivTzx OnG8bfnS+/DjJANciZQpQKm7BMP2wmavv9294Zenga6sKZFrvEVZT282SDLBOPFZgaMh B3WxccVRlR2yYD8+DIVhtdAinGWa5QLYqft2o9nN+KqkRq6/+nOVtyUgtdlZSJe1yzRb tFHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=RIVCX+XUYs7tHWDDLwkfAWlRNAdgWRkqf02BdqfHzz4=; b=hA3DD6Jale3MLV01ywsO4k9K3PNa6NjDtv3f5v6+bpUDnFEqZ9QjuxFsIA904oHJBE BwalTBER1cpIJHAUMA7V0LapG8SSwZwhxxK+8Wmno4P5jHGDgU3XAuKHDF2rNZoluNcL k3Xfwn6P57p5r9yCUP2Y5Nk1iTVarUBqCZM1Ir0scNKHMEZaaxgzkck5/2gOamadkgFW 548amp8TtQbGYE63qBPVxY+USCxmBz6ymNw/w4u0/b26ILWikPxD75XFw1TEgdD5uPx0 hF2VNWhlWW/KGYLCQtJY7sVFBGg7Yg81VtelZ/OTOQknYQvKugrFuUabcD2TWYFpvjX0 kwHg== X-Gm-Message-State: AOPr4FUqpnv1VfENGAXWPSFMuA3c1S9uAeDz8O8KwB2zzhQYcygzNJ2Yk3ZPqzroB2Ou1x0e54N4JW6bEbmyxA== X-Received: by 10.50.72.107 with SMTP id c11mr11457415igv.85.1460563589603; Wed, 13 Apr 2016 09:06:29 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com comp.lang.python:106955 On Wed, Apr 13, 2016 at 9:53 AM, salma ammar wrote: > Hi, > > I am about to run this code using python 2.7. But when executing this code, > an error appears (see attachement): IdentationError; unexpected indent > > What should I rectify to correct this error please? First of all, please post your code exactly as you're trying to run it. All those asterisks make it harder to read and also create doubts about what other changes might have been introduced in the process of being posted. Second, read the error message. It tells you what the problem is: unexpected indent. It should also tell you exactly line the error occurs on, but you didn't include that part of the error message in your post, so we can't help you there. Next time, please post the entire error message, including the traceback. > * edges = net.getNeighboringEdges(x, y, radius)* > * distancesAndEdges = sorted([(dist, edge) for edge, dist in edges])* > * print(distancesAndEdges)* > * edgeofstation[id] = distancesAndEdges[0]* > * print (edgeofstation[id])* That said, these five lines all appear to have inconsistent indentation with the preceding. I don't know what the intent was, but you should correct the indentation of these lines.