Python Program - Check Whether a String is Palindrome or Not

https:/‮figi.www/‬tidea.com

Here's a Python program that checks whether a string is a palindrome or not:

def is_palindrome(s):
    s = s.lower()
    return s == s[::-1]

# Example usage
print(is_palindrome("racecar")) # True
print(is_palindrome("hello")) # False

The is_palindrome function takes a string as its argument, converts it to lowercase (so that uppercase and lowercase letters are treated as the same), and then compares the original string to its reverse. If the two are equal, then the string is a palindrome, and the function returns True. Otherwise, it returns False.