title: Accounting spaces in palindrome program
body: <p>This is a program that accepts a string of words and checks if the words are palindromes and if it is one, it prints it. However if a string has a space in it, my program won't count it as a palindrome (Example: nurses run). What should I be adding to make the program exclude the space, when it's accounting for palindromes?</p>
  
  <p>Palindrome: a word, phrase, or sequence that reads the same backwards as forwards, e.g. 'madam' or 'nurses run'</p>
  
  <pre><code>import sys
  
  strings = []
  for s in sys.argv[1:]:
      strings += [s]
  
  def is_palindrome(word):
      if len(word) &lt;= 2 and word[0] == word[-1]:
          return True
      elif word[0] == word[-1]:
          is_palindrome(word[1:-1])
          return True
      else:
          return False
  
  
  def printpalindromes(strings):
      for s in strings:
          if is_palindrome(s) == True:
              print(s)
  
  printpalindromes(strings)
  </code></pre>