Skip to content

Write a Program to Check Whether the Given String is Palindrome or Not

Class 11th IP (065)

Write a Program to Check Whether the Given String is Palindrome or Not

SOLUTION..

text = input("Enter a string: ") # Convert to lowercase to make the check case-insensitive text = text.lower() # Reverse the string reverse_text = text[::-1] if text == reverse_text: print("The given string is a Palindrome") else: print("The given string is NOT a Palindrome")