Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #48935
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Subject | Re: Simple I/O problem can't get solved |
| Date | 2013-06-22 12:58 -0400 |
| Organization | IISS Elusive Unicorn |
| References | <4785de5f-a84d-4417-9709-68bf2f4076e8@googlegroups.com> <kq15i6$80e$1@ger.gmane.org> <CAPTjJmoCTvXRMfU2aiZMM-6UiyHspbgRfMFSqHqr+Xm5nHUE1A@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3700.1371920311.3114.python-list@python.org> (permalink) |
On Sat, 22 Jun 2013 19:07:59 +1000, Chris Angelico <rosuav@gmail.com>
declaimed the following:
>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'.
>
There's also the matter of whether one is looking for strict
palindromes -- where spacing is included (but not letter case)
Able was I ere I saw Elba
or a looser definition where only the letters are involved in the
determination (again ignore case and punctuation, but also ignore the
spaces between words)
Madam I'm Adam
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll 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