Function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). For example, “radar” and “level” are palindromes.
def pall(i):
b=i[ : :-1]
if b==i:
print(‘the given word is a pallindrome’)
else:
print(‘the given word is not a pallindrome’)
i=input('enter a word: ')
pall(i)
print()
1 Like