using reverse in list of tuples

Dan Stromberg drsalists at gmail.com
Wed Jun 9 21:01:40 EDT 2010


$ python
Python 2.5.1 (r251:54863, Nov  2 2007, 11:57:24)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> list_ = [(1,2), (3,4), (5,6)]
>>> print list_.reverse()
None
>>> print list_
[(5, 6), (3, 4), (1, 2)]
>>>


On Wed, Jun 9, 2010 at 5:39 PM, james_027 <cai.haibin at gmail.com> wrote:

> hi,
>
> I am trying to reverse the order of my list of tuples and its is
> returning a None to me. Is the reverse() function not allow on list
> containing tuples?
>
> Thanks,
> James
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100609/ad89d6e0/attachment-0001.html>


More information about the Python-list mailing list