Returns a reverse iterator over a sequence.
reversed (sequence)
- sequence
- Required. Any iterable sequence.
#TODO
#TODO
sequence must be an object which has a __reversed__() method or supports the sequence protocol (the __len__() method and the __getitem__() method with integer arguments starting at 0).
>>> r = reversed([1, 2])
>>> r.next()
2
>>> r.next()
1
>>> r.next()
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
StopIteration>>> for r in reversed((1, 2)):
... print r
...
2
1#TODO