Program to check if a string is palindrome or not




#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

Popular Posts