A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/081966.html below:

Tuples ? How to ?

Tuples ? How to ?Rikard Bosnjakovic bos at hack.org
Tue Apr 3 06:49:46 EDT 2001
Mickael ABBAS wrote:

> How to make a imbricated tuple as, for example:
> ((1,10),(2,20),(3,30))
> when we don't know the size and we have only the two lists:
> [1,2,3] and
> [10,20,30]

>>> a = (1,2,3)
>>> b = (5,6,7)
>>> zip(a,b)
[(1, 5), (2, 6), (3, 7)]
>>> map(None, a, b)
[(1, 5), (2, 6), (3, 7)]


I think zip() is Python 2.0, but I'm not sure.

-- 
Rikard Bosnjakovic - http://a214.ryd.student.liu.se/cv/ - ICQ: 1158217

Anyone sending unwanted advertising e-mail to my address will be
charged $250 for network traffic and computing time. By extracting my
address from this message or its header, you agree to these terms.

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4