From debf9d89c02a9fe62f470d19cef378e9387626f9 Mon Sep 17 00:00:00 2001 From: Anantha Sai Date: Fri, 7 Nov 2025 09:04:08 +0530 Subject: [PATCH 1/2] feat: add palindrome checker script --- scripts/palindrome_checker.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/palindrome_checker.py diff --git a/scripts/palindrome_checker.py b/scripts/palindrome_checker.py new file mode 100644 index 000000000000..3c698896c230 --- /dev/null +++ b/scripts/palindrome_checker.py @@ -0,0 +1,17 @@ +# palindrome_checker.py +# Simple palindrome checker +# Author: Ananth Sai + +def is_palindrome(s: str) -> bool: + s = "".join(ch.lower() for ch in s if ch.isalnum()) + return s == s[::-1] + +def main(): + text = input("Enter a word or phrase: ").strip() + if is_palindrome(text): + print(f"✅ '{text}' is a palindrome!") + else: + print(f"❌ '{text}' is not a palindrome.") + +if __name__ == "__main__": + main() From 00683233b4bbc29dd478667ebb7f6b7ee504fc64 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 03:39:30 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/palindrome_checker.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/palindrome_checker.py b/scripts/palindrome_checker.py index 3c698896c230..a9c6f3a19d04 100644 --- a/scripts/palindrome_checker.py +++ b/scripts/palindrome_checker.py @@ -2,10 +2,12 @@ # Simple palindrome checker # Author: Ananth Sai + def is_palindrome(s: str) -> bool: s = "".join(ch.lower() for ch in s if ch.isalnum()) return s == s[::-1] + def main(): text = input("Enter a word or phrase: ").strip() if is_palindrome(text): @@ -13,5 +15,6 @@ def main(): else: print(f"❌ '{text}' is not a palindrome.") + if __name__ == "__main__": main()