Mensanator wrote:

It hasn't. and here's why:

IDLE 2.6b1
seq=['a','n','n','a']
seq.reversed()

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    seq.reversed()
AttributeError: 'list' object has no attribute 'reversed'

My apologies. reversed() is a builtin func, not a method, and it produces an iterator, not a seq. SO, corrected,

>>> for s in ((1,2,3,2,1), [1,2,3,2,1]):
...   type(s)(reversed(s)) == s
...
True
True
>>> s = '12121'
>>> ''.join(reversed(s)) == s
True

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to