写一个代码

not image

```python def is_palindrome(text): """ 检查给定的字符串是否是回文。 Args: text: 要检查的字符串。 Returns: 布尔值,True 表示是回文,False 表示不是回文。 """ processed_text = ''.join(c for c in text.lower() if c.isalnum()) return processed_text == processed_text[::-1] user_input = input("请输入一个字符串: ") if is_palindrome(user_input): print(f"'{user_input}' 是回文") else: print(f"'{user_input}' 不是回文") ``` Let me know what other codes you'd like to see!

评论区:

评论:

请输入内容: