Write a program to check whether the string is palindrome or not.

s=input("Enter any string")
rstr=''
print("original string is ",s)
for i in range(len(s)):
    rstr=s[i]+rstr
print("Reverse string is ",rstr)

if(s==rstr):
    print("String is palindrome")
else:
    print("String is not palindrome")

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *