Question #349928

# Accept string input.

# Display if the string is Palindrome or Not a Palindrome


Expert's answer

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.")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS