"Noah" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a list of tuples
>     [('a', 1.0), ('b', 2.0), ('c', 3.0)]
> I want to reverse the order of the elements inside the tuples.
>     [(1.0,'a'), (2.0, 'b'), (3.0, 'c')]
>

>>> tups =  [('a', 1.0), ('b', 2.0), ('c', 3.0)]
>>> map(tuple,map(reversed,tups))
[(1.0, 'a'), (2.0, 'b'), (3.0, 'c')]


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

Reply via email to