MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / palindrome

Function palindrome

example_code/item_118.py:51–53  ·  view source on GitHub ↗

Return True if the given word is a palindrome.

(word)

Source from the content-addressed store, hash-verified

49
50print("Example 1")
51def palindrome(word):
52 """Return True if the given word is a palindrome."""
53 return word == word[::-1]
54
55assert palindrome("tacocat")
56assert not palindrome("banana")

Callers 1

item_118.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected