I have a palindrome recursion function, which works for every word except for ones with spaces. How do I fix the code to not take spaces into account?
def ispalindrome(word):
if len(word) < 2:
return True
if word[0] != word[-1]:
return False
return ispalindrome(word[1:-1])
print(ispalindrome("taco cat"))