Skip to content

Instantly share code, notes, and snippets.

Created Feb 23, 2021
What would you like to do?
def palindrome(sentence):
for i in (",.'?/><}{{}}'"):
sentence = sentence.replace(i, "")
palindrome = []
words = sentence.split(' ')
for word in words:
word = word.lower()
if word == word[::-1]:
return palindrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment