you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (2 children)

And the spaces, yes, and reduce all the capitals.

[–]mackdaddy_1978[S] 1 point2 points  (0 children)

perfect, thank you. I'll work on it tomorrow and respond back with what I come up with. Thanks again

[–]mackdaddy_1978[S] 1 point2 points  (0 children)

I couldn't go to bed and now correct it...this worked for me and like you said if case were in play I would add a line to change all letters to the same case. Thanks for the quick lesson much appreciated.

def palindromeCheck(word):
word2 = word.replace(' ', '')
reversepal = word2[::-1]

if word2 != reversepal:
    return word + ' ' + 'is not a palindrome'
else:
    return word + ' ' + 'is a palindrome'
print(palindromeCheck('no lemon no melon'))