Python program to check whether a string is Palindrome or not

    
        # Get input from the user
        user_input = input("Enter a string: ")

        # Convert the string to lowercase to make the comparison case-insensitive
        s = user_input.lower()

        # Remove spaces from the string
        s = s.replace(" ", "")

        # Compare the original string with its reverse
        if s == s[::-1]:
            print(f"{user_input} is a palindrome!")
        else:
            print(f"{user_input} is not a palindrome.")
    
Output 1:
    
        Enter a string: test
        test is not a palindrome.
    
Output 2:
    
        Enter a string: madam
        madam is a palindrome!