We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae68a78 commit debf9d8Copy full SHA for debf9d8
scripts/palindrome_checker.py
@@ -0,0 +1,17 @@
1
+# palindrome_checker.py
2
+# Simple palindrome checker
3
+# Author: Ananth Sai
4
+
5
+def is_palindrome(s: str) -> bool:
6
+ s = "".join(ch.lower() for ch in s if ch.isalnum())
7
+ return s == s[::-1]
8
9
+def main():
10
+ text = input("Enter a word or phrase: ").strip()
11
+ if is_palindrome(text):
12
+ print(f"✅ '{text}' is a palindrome!")
13
+ else:
14
+ print(f"❌ '{text}' is not a palindrome.")
15
16
+if __name__ == "__main__":
17
+ main()
0 commit comments