Write a function to check if a string is a palindrome.
user
def is_palindrome(text):
    # Remove spaces and convert to lowercase
    text = text.replace(' ', '').lower()
    # Check if the string is equal to its reversed form
    return text == text[::-1]
assistant