#program to accept a string from the user and check if it is palindrome or not s=input(("Enter a string: "))
if(s==s[::-1]): #if the reverse of a string is equal to the original string, it is a palindrome
print("The given string is a palindrome")
else:
print("The given string is not a palindrome")
Comments
Post a Comment