Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,39 @@
def is_palindrome(s):
'''
>>> is_palindrome('')
True
>>> is_palindrome('a')
True
>>> is_palindrome('aa')
True
>>> is_palindrome('baa')
False
>>> is_palindrome('baab')
True
>>> is_palindrome('ba_ab')
True
>>> is_palindrome('ba_ ab')
False
>>> is_palindrome('ba _ ab')
True
>>> is_palindrome('ab'*2)
False
>>> x = 'ab' *2**15
>>> len(x)
65536
>>> xreversed = x[::-1]
>>> is_palindrome(x+xreversed)
True
>>> len(x+xreversed)
131072
>>>
'''
return s == s[::-1]
def _test():
import doctest
doctest.testmod()
#doctest.testmod(verbose=True)
if __name__ == "__main__":
_test()