nested tuple slice

dimitri pater dimitri.pater at gmail.com
Tue Apr 12 17:49:27 EDT 2005


hello!

I want to change a nested tuple like:
tuple = (('goat', 90, 100), ('cat', 80, 80), ('platypus', 60, 800))
into:
tuple = (('goat', 90), ('cat', 80), ('platypus', 60))

in other words, slice the first elements of every index

Any ideas on how to do this in an elegant, pythonic way?

Best regards,
Dimitri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050412/5596f189/attachment.html>


More information about the Python-list mailing list