Skip to content

Commit 0068323

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent debf9d8 commit 0068323

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/palindrome_checker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
# Simple palindrome checker
33
# Author: Ananth Sai
44

5+
56
def is_palindrome(s: str) -> bool:
67
s = "".join(ch.lower() for ch in s if ch.isalnum())
78
return s == s[::-1]
89

10+
911
def main():
1012
text = input("Enter a word or phrase: ").strip()
1113
if is_palindrome(text):
1214
print(f"✅ '{text}' is a palindrome!")
1315
else:
1416
print(f"❌ '{text}' is not a palindrome.")
1517

18+
1619
if __name__ == "__main__":
1720
main()

0 commit comments

Comments
 (0)