I have the user input strings until they are finished at which point they input Done. I then check each string to see if it is a palindrome or not. If the string is a palindrome then, I then insert it into a list. I have my palindrome checking code working for strings like "swap paws" but it does not work for strings like "taco cat". I can't include libraries to help me with this so I'm unsure as to how I can go about ignoring spaces and case. This isn't the same as other questions asked here because the ones that do talk about ignoring space and case use libraries and the others just talk about checking if a basic string with no spaces or anything special is a palindrome. Here is my code:
plist={}
val=1
print("Enter the strings: ")
inp = raw_input() # Get the input
if(inp==inp[::-1]):
plist[inp] = val
while inp != "Done": # Loop until Done is entered
if(inp==inp[::-1]): # inp==inp[::-1]
plist[inp] = val
inp = raw_input() # Get the input again
print("The palindromes are: ")
print(plist)