zip list with different length

Alexander Schmolck a.schmolck at gmail.com
Wed Apr 4 05:09:03 EDT 2007


MC <XX.XmcX at XX.XmclaveauX.com> writes:

> Hi!
> 
> Brutal, not exact answer, but:
> 
> a = range(5)
> b = range(3)
> print zip(a+[None]*(len(b)-len(a)),b+[None]*(len(a)-len(b)))

You reinvented map(None,a,b).

'as



More information about the Python-list mailing list