title: Palindrome program in python using file i/o
body: <p>I am new to python and working on a few programs to get a hang of it. 
  I am making a palindrome program which takes input from a file and prints out the words that are palindromes. Here is the code i have so far</p>
  
  <pre><code>def isPalindrome(word):
      if len(word) &lt; 1:
          return True
      else:
          if word[0] == word[-1]:
              return isPalindrome(word[1:-1])
          else:
              return False
  
  def fileInput(filename):
      file = open(filename,'r')
      fileContent = file.readlines()
      if(isPalindrome(fileContent)):
          print(fileContent)
      else:
          print("No palindromes found")
      file.close()
  </code></pre>
  
  <p>this is the file</p>
  
  <pre><code>moom
  mam
  madam
  dog
  cat
  bat
  </code></pre>
  
  <p>i get output of no palindromes found.</p>