Answer to Question #196607 in Python for siddhartha

Question #196607

Write a program to input a number or word from the user and find its reverse. If the reverse is the same as the input then it is a palindrome. Check if the text is a palindrome or not.


1
Expert's answer
2021-05-21T17:00:39-0400
x = input("Enter the string : ")
y = x[::-1]
# printing reverse string
print("Reverse of the string: ",y)
# checking whether palindrome or not
if y == x:
    print("String is palindromic")
else:
    print("String is not palindromic")

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