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


Groups > comp.lang.python > #48920

Re: Simple I/O problem can't get solved

References <4785de5f-a84d-4417-9709-68bf2f4076e8@googlegroups.com> <kq15i6$80e$1@ger.gmane.org>
Date 2013-06-22 19:07 +1000
Subject Re: Simple I/O problem can't get solved
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3690.1371892081.3114.python-list@python.org> (permalink)

Show all headers | View raw


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

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


Thread

Simple I/O problem can't get solved nickgan.sps@windowslive.com - 2013-06-21 01:57 -0700
  Re: Simple I/O problem can't get solved Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-06-21 12:11 +0300
  Re: Simple I/O problem can't get solved Peter Otten <__peter__@web.de> - 2013-06-21 11:15 +0200
    Re: Simple I/O problem can't get solved nickgan.sps@windowslive.com - 2013-06-21 02:20 -0700
  Re: Simple I/O problem can't get solved Chris Angelico <rosuav@gmail.com> - 2013-06-22 19:07 +1000
  Re: Simple I/O problem can't get solved Peter Otten <__peter__@web.de> - 2013-06-22 12:11 +0200
  Re: Simple I/O problem can't get solved Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-22 12:58 -0400

csiph-web