I am currently taking a course on Python and am currently struggling with one portion of my homework.
The question is asking us to construct a function that checks a string to see if it is a palindrome. The problem I am having is that for one of the tests my instructor has provided is for the palindrome "Never odd or even" which contains spaces. The spaces are causing my function to fail because it won't just use the letters in the phrase.
My current code is:
def is_palindrome(phrase):
return phrase == phrase[::-1]
She is testing with the code:
assert is_palindrome("Never odd or even")
Any help would be appreciated! Thanks.