To check whether given input is palindrome or not in python

 string = input("Enter a string")

string = string.casefold()

revofstring = reversed(string)

if list(string) == list(revofstring):

    print("The string is palindrome")

else:

     print("The string is not palindrome")


Comments

Popular posts from this blog

Data Science Matplotlib Library Data Visualization, ASSIGNMENT - 6, GO_STP_8113