A palindrome is a word, phrase, or sequence that reads the same backward as forward, e.g., madam, nurses run, etc.
Consider the below code:
def fun(string):
s1 = string
s = string[::-1]
if(s1 == s):
return true
else:
return false
print(fun(“madam”))