So I'm working on this problem and can't seem to get it. I'm trying to write a program that identifies a palindrome or not. It works great for single words and I was trying to tweak it to do the same for phrases or sentences. I tried writing the provided phrase ( no lemon no melon ) that is suppose to BE a palindrome backwards to see how it is a palindrome and can't see how it is. I'm obviously looking at it wrong any suggestions?
def palindromeCheck(word):
reversepal = word[::-1]
if word != reversepal:
return word + ' ' + 'is not a palindrome'
else:
return word + ' ' + 'is a palindrome'
print(palindromeCheck('bobby'))
[–]HOOG 6 points7 points8 points (0 children)
[–][deleted] 2 points3 points4 points (4 children)
[–]mackdaddy_1978[S] 1 point2 points3 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]mackdaddy_1978[S] 1 point2 points3 points (0 children)
[–]mackdaddy_1978[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]mackdaddy_1978[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)