MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / is_palindrome_slice

Function is_palindrome_slice

strings/palindrome.py:74–81  ·  view source on GitHub ↗

Return True if s is a palindrome otherwise return False. >>> all(is_palindrome_slice(key) == value for key, value in test_data.items()) True

(s: str)

Source from the content-addressed store, hash-verified

72
73
74def is_palindrome_slice(s: str) -> bool:
75 """
76 Return True if s is a palindrome otherwise return False.
77
78 >>> all(is_palindrome_slice(key) == value for key, value in test_data.items())
79 True
80 """
81 return s == s[::-1]
82
83
84def benchmark_function(name: str) -> None:

Callers 1

palindrome.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected