palindrome iteration
Chris Colbert
sccolbert at gmail.com
Sun Sep 12 09:02:56 EDT 2010
;)
In [29]: s = 'bannab'
In [30]: a = np.frombuffer(s.lower(), dtype='uint8')
In [31]: np.all(a == a[::-1])
Out[31]: True
In [32]: s = 'bannac'
In [33]: a = np.frombuffer(s.lower(), dtype='uint8')
In [34]: np.all(a == a[::-1])
Out[34]: False
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100912/f9e77d76/attachment-0001.html>
More information about the Python-list
mailing list