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: > line = f.readline() > if len(line) == 0: > break > elif is_palindrome.is_palindrome(line): > print line, > f.close()
There's a newline at the end of each input line. Strip that. (It might be another sequence that means end-of-line in your system. It can still be stripped as trailing whitespace. Strings have a method for stripping trailing whitespace.) -- http://mail.python.org/mailman/listinfo/python-list