import re def is_palindrome(text): text = text.lower() # تبدیل به حروف کوچک text = re.sub(r'[^a-z0-9]', '', text) # حذف فاصله و علائم غیرحروفی return text == text[::-1] # دریافت ورودی از کاربر text = input("Enter string: ") # بررسی و نمایش نتیجه if is_palindrome(text): print(f"'{text}' is palindrom.") else: print(f"'{text}' is not palindrom.")