MCPcopy Create free account
hub / github.com/geekcomputers/Python / is_palindrome

Function is_palindrome

palindrome.py:1–10  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

1def is_palindrome(text):
2 text = text.lower()
3
4 cleaned = ""
5 for char in text:
6 if char.isalnum():
7 cleaned += char
8
9 reversed_text = cleaned[::-1]
10 return cleaned == reversed_text
11
12
13user_input = input("Enter a word or a sentence:")

Callers 1

palindrome.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected