Palindrome
Peter Otten
__peter__ at web.de
Thu Nov 13 19:09:26 EST 2003
More information about the Python-list mailing list
Thu Nov 13 19:09:26 EST 2003
- Previous message (by thread): Palindrome
- Next message (by thread): Palindrome
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Ben Finney wrote: > I have yet to try this on the world's longest palindrome: > > <http://www.norvig.com/palindrome.html> > is_pal = ( str == str[::-1] ) For really long palindromes, you might not want to reverse the whole string: p.endswith(p[:len(p)//2:-1]) Peter
- Previous message (by thread): Palindrome
- Next message (by thread): Palindrome
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list