title: Palindrome function not working in Python
body: <p>the following is part of a much bigger program.</p>
  
  <pre><code>wordStr = open("words.txt",'rU')
  
  def isPalindrome(wordStr):
      palindromeCount = 0
      for word in wordStr:
          if word == word[::-1]:
              palindromeCount += 1
      print palindromeCount
  
  isPalindrome(wordStr)
  </code></pre>
  
  <p>words.txt contains thousands of words and it is in the same folder as the program. With this function I am trying to go through and count the number of words that are palindromes (spelled the same front and back) in the text file. It simply returns 0 every time and never even gets into the if statement and I can't figure out why.</p>