Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-2.dfn.de!news-1.dfn.de!news.dfn.de!storethat.news.telefonica.de!feedme.news.telefonica.de!telefonica.de!diesel.cu.mi.it!.POSTED!not-for-mail From: giacomo boffi Newsgroups: comp.lang.python Subject: Re: What does zip mean? Date: Thu, 13 Nov 2014 23:10:56 +0100 Organization: The Sun and the Rain. Lines: 22 Message-ID: <87a93uiwen.fsf@pascolo.net> References: NNTP-Posting-Host: ppp-9-2.21-151.libero.it Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: virtdiesel.mng.cu.mi.it 1415916657 10037 151.21.2.9 (13 Nov 2014 22:10:57 GMT) X-Complaints-To: abuse@diesel.cu.mi.it NNTP-Posting-Date: Thu, 13 Nov 2014 22:10:57 +0000 (UTC) User-Agent: Gnus/5.101 (Gnus v5.10.10) XEmacs/21.5-b34 (linux) Cancel-Lock: sha1:PIkXVtnNMZVHL+ciHCIV9f1ddAE= Xref: csiph.com comp.lang.python:80705 Grant Edwards writes: > No, you don't. That's not how a zipper works. Each tooth from side A, > isn't bound with one from side B. It's bound with _two_ of them from > side B. And each of those is in turn bound with an additional tooth > from side A, and so on... > >> In your program you have two lists, whose elements `zip` returns >> bound together in pairs > > What the zipper on a coat does is convert two separate sequences into > a single sequence where the members alternate between the two input > sequences. IOW if we want to do something analogous to a zipper > fastener it should do this: > > zip([a,b,c,d,e,f],[1,2,3,4,5,6]) => [a,1,b,2,c,3,d,4,e,5,f,6] > > Item '1' is bound equally to item 'a' and 'b'. Item 'b' is bound > equally to item '1' and '2'. I love you folks of CLP