Answer to Question #349928 in Python for Darkninja

Question #349928

# Accept string input.

# Display if the string is Palindrome or Not a Palindrome


1
Expert's answer
2022-06-13T11:13:34-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS