Palindrome

Find all palindromic words in a file
def words(fileobj): for line in fileobj: for word in line.split: yield word with open("words.txt") as wordfile: wordgen = words(wordfile) for word in wordgen: if word == word[::-1]: print(word),
 * 1) !/usr/bin/python