strings.palindrome

Attributes

test_data

Functions

benchmark_function(→ None)

is_palindrome(→ bool)

Return True if s is a palindrome otherwise return False.

is_palindrome_recursive(→ bool)

Return True if s is a palindrome otherwise return False.

is_palindrome_slice(→ bool)

Return True if s is a palindrome otherwise return False.

is_palindrome_traversal(→ bool)

Return True if s is a palindrome otherwise return False.

Module Contents

strings.palindrome.benchmark_function(name: str) None
strings.palindrome.is_palindrome(s: str) bool

Return True if s is a palindrome otherwise return False.

>>> all(is_palindrome(key) is value for key, value in test_data.items())
True
strings.palindrome.is_palindrome_recursive(s: str) bool

Return True if s is a palindrome otherwise return False.

>>> all(is_palindrome_recursive(key) is value for key, value in test_data.items())
True
strings.palindrome.is_palindrome_slice(s: str) bool

Return True if s is a palindrome otherwise return False.

>>> all(is_palindrome_slice(key) is value for key, value in test_data.items())
True
strings.palindrome.is_palindrome_traversal(s: str) bool

Return True if s is a palindrome otherwise return False.

>>> all(is_palindrome_traversal(key) is value for key, value in test_data.items())
True
strings.palindrome.test_data