Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.128 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.76; '*S*': 0.02; '21,': 0.07; "wouldn't": 0.14; 'expecting': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'print': 0.22; '(such': 0.24; 'subject:problem': 0.24; 'subject:/': 0.26; 'header :In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'lines': 0.31; 'minor': 0.31; 'file': 0.32; 'fri,': 0.33; "i'd": 0.34; 'received:google.com': 0.35; 'consist': 0.36; 'subject:Simple': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'subject:can': 0.39; 'to:addr:python.org': 0.39; "you're": 0.61; 'name': 0.63; 'combining': 0.68; 'subject:get': 0.81; 'detecting': 0.84; 'otten': 0.84; '2013': 0.98 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:to :content-type; bh=MoNMCLvY0oLJOwWNGJ/rW8l4Rv7CHQjBimTwLAQCtYA=; b=RmDFGP13mz8/Lij7yBCCmqu8uND0WoTzwS5K+daal83RE8Kd6NCkfidG3Jmsmjgzhf tUkLee98b71nhm6IZSMPSdw3MNByIGdgEpi/sW79IJOrsjCfmUtDrMCYqy/m7DutT01i /TaDvXYRr66Yri2Gq9IpxvvRH9tKM/zT85KO4QdxRGYjuHSqX/IvvkYFhSXzim3U7BI0 63uOkYTNKR94Ho0DxSGoQr/ilfFD34qCdLt/ejQL/jDqBFr/yFe4CXLPscjaPWw1xKHj O8fvoghrqjMQSkDXGtlDPEk6alwVbvEoiZ+nYrPsMkvhiPps45U5ZvsQwpeZqjK9bZbV q77Q== MIME-Version: 1.0 X-Received: by 10.220.182.193 with SMTP id cd1mr7292745vcb.32.1371892079290; Sat, 22 Jun 2013 02:07:59 -0700 (PDT) In-Reply-To: References: <4785de5f-a84d-4417-9709-68bf2f4076e8@googlegroups.com> Date: Sat, 22 Jun 2013 19:07:59 +1000 Subject: Re: Simple I/O problem can't get solved From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371892081 news.xs4all.nl 15897 [2001:888:2000:d::a6]:44598 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48920 On Fri, Jun 21, 2013 at 7:15 PM, Peter Otten <__peter__@web.de> wrote: > Combining these modifications: > > for line in f: > word = line.strip() > if is_palindrome.is_palindrome(word): > print word Minor quibble: I wouldn't use the name 'word' here, unless you're expecting the file to consist of one-word lines (such as DICTOT.DIC from old PMMail). For detecting phrase/sentence palindromes, I'd keep the name 'line'. ChrisA