# Accept string input.
# Display if the string is Palindrome or Not a Palindrome
string = input("Enter string: ")
string = string.casefold()
rev_str = reversed(string)
if list(string) == list(rev_str):
print("The string is a palindrome.")
else:
print("The string is not a palindrome.")
Comments
Leave a comment