9951 explained code solutions for 126 technologies


pythonCheck if a given string is a palindrome


def is_palindrome(word):
    return word.lower() == word[::-1].lower()

print(palindrome("Racecar"))ctrl + c
is_palindrome(

function name to check if the string is a palindrome

.lower(

converts the string to lowercase

word[::-1]

reverses the string

return

returns True if the string is a palindrome