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

2013-06-22 Thread Peter Otten
Chris Angelico wrote: > On Fri, Jun 21, 2013 at 7:15 PM, Peter Otten <__pete...@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' her

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

2013-06-22 Thread Chris Angelico
On Fri, Jun 21, 2013 at 7:15 PM, Peter Otten <__pete...@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

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

2013-06-21 Thread nickgan . sps
Τη Παρασκευή, 21 Ιουνίου 2013 12:15:59 μ.μ. UTC+3, ο χρήστης Peter Otten έγραψε: > nickgan@windowslive.com wrote: > > > > > I have recently started to solve my first Python problems but I came > > > across to this: > > > Write a version of a palindrome recogniser that accepts a file name f

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

2013-06-21 Thread Jussi Piitulainen
nickgan@windowslive.com writes: > I think I coded it correctly but still I get no output. I do not > have any errors I just do not get any output. > > This is the code: > > *** > import is_palindrome > > filename = raw_input('Enter a file: ') # A text file > f = open(filename) > while True:

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

2013-06-21 Thread Peter Otten
nickgan@windowslive.com wrote: > I have recently started to solve my first Python problems but I came > across to this: > Write a version of a palindrome recogniser that accepts a file name from > the user, reads each line, and prints the line to the screen if it is a > palindrome.(by http://w

Simple I/O problem can't get solved

2013-06-21 Thread nickgan . sps
Greetings to everybody, I have recently started to solve my first Python problems but I came across to this: Write a version of a palindrome recogniser that accepts a file name from the user, reads each line, and prints the line to the screen if it is a palindrome.(by http://www.ling.gu.se/~lag