Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'else:': 0.03; 'elif': 0.05; 'column': 0.07; 'subject:characters': 0.09; 'cc:addr:python- list': 0.11; 'jan': 0.12; 'commonly,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:Remove': 0.16; 'wrote:': 0.18; 'written': 0.21; 'cc:addr:python.org': 0.22; 'instead.': 0.24; 'cc:2**0': 0.24; 'define': 0.26; 'handling': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'character': 0.29; 'characters': 0.30; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; 'figure': 0.32; 'limitation': 0.33; 'monday,': 0.33; 'subject:from': 0.34; "can't": 0.35; 'received:google.com': 0.35; 'should': 0.36; 'january': 0.37; 'two': 0.37; 'issue': 0.38; 'how': 0.40; 'remove': 0.60; 'address': 0.63; 'more': 0.64; '100': 0.79; '10:': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=vqSNRwQa453N/4Hk0EZwrVLNjLtffe3avliTH/opicQ=; b=hw5GBXY+dtNFKNmnVLrhH0nX3b5DykTxqf00GekMtTzNPBRdh5QzpqMXS1XuSTq4P3 dNlktRvXXVosoX48ogjxCuzkcP4VcXgwA+8Auccl4AWFPt+RioH7kr9yF0jcMPfYceSL 0sjuxJSlHxqCHepAgXb8sxrlxiSTK+1OuRMH5QbCbM3S57Sb59lawWR1QMFlUziTp3Na ls4vc017nOp58qX+FoHlz0gCFuOR+ouJSTr4MKABRbO78R2xvjhEDatM9HUuMUZRQUWb Ksyw6bRGqJo5pZDJwaueBCzvze/46QyCVHUkz/FAAz55IPjXEFzgUp7CeD6SOtNEDeyX 8fIw== MIME-Version: 1.0 X-Received: by 10.66.118.71 with SMTP id kk7mr30673327pab.14.1390835999072; Mon, 27 Jan 2014 07:19:59 -0800 (PST) In-Reply-To: <948612d7-8e69-46d0-9fab-707b762a48a7@googlegroups.com> References: <8d703876-ba90-492d-a558-a5a9bb8023c7@googlegroups.com> <04d509f9-54fa-4ba5-bb6e-24ce60e12523@googlegroups.com> <52e6650c$0$29999$c3e8da3$5496439d@news.astraweb.com> <9b121fe6-9ed8-4adf-af24-80166f348c7d@googlegroups.com> <948612d7-8e69-46d0-9fab-707b762a48a7@googlegroups.com> Date: Tue, 28 Jan 2014 02:19:59 +1100 Subject: Re: Remove unwanted characters from column From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1390836009 news.xs4all.nl 2830 [2001:888:2000:d::a6]:58257 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64869 On Tue, Jan 28, 2014 at 2:03 AM, wrote: > On Monday, 27 January 2014 09:57:32 UTC-5, Chris Angelico wrote: >> On Tue, Jan 28, 2014 at 1:23 AM, wrote: >> >> > If the farmID < 10: >> > remove one character from the address column >> > Elif farmID > 10: >> > remove two characters from the address column >> >> What if farmID == 10? >> >> ChrisA > > Ok, sorry this is how it should be. > > If the FarmID < 10: > remove one character from the address column > > If the FarmID > 9: > remove two characters from the address column > > My issue is I can't figure out what statement to use to define FarmID. More commonly, that would be written as if farmID < 10: # remove one character else: # remove two characters Though this still suffers from the limitation of not handling 100 or 1000, so you might want to look at len(str(farmID)) instead. ChrisA