Questions
Write a python program to check whether a given string is a Palindrome or not.
Last Updated : 26 Jul 2026
Jan 21, Jan 22, Jan 23, Jul 23, Jan 24
Solution:
# Take input from the user
user_string = input("Enter a string: ")
# Check if the string is equal to its reverse
if user_string == user_string[::-1]:
print("The string is a palindrome.")
else:
print("The string is not a palindrome.")
Report an error