6th_palindrome
def palindrome(s):
rst=""
for i in range(len(s)):
rst=s[i]+rst
if s==rst:
return True
else:
return False
st=input("Enter a string: ")
r=palindrome(st)
if r==True:
print("The given string is palindrome")
else:
print("The given string is not palindrome")
Comments
Post a Comment