as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write a python program to check if a given string is a palindrome or not.
user
def is_palindrome(string):
    # remove punctuation and whitespace
    cleaned_string = "".join(filter(str.isalnum, string)).lower() 
    # check if the string is the same in reverse
    return cleaned_string == cleaned_string[::-1]
assistant