| |
comp.lang.python |
On May 26, 4:54 am, mosscliffe <mcl.off...@googlemail.com> wrote: > Richard > lista = ['a1', 'a2'] > for x,y in zip(lista, listb): # Fine Truncates as expected > for x,y in map(None, lista, listb): # Also fine - extends as > for x,y in map("N/A", lista, listb): ########## Fails - Can not call a > def fillwith(fillchars): > for x,y in map(fillwith("N/A"), lista, listb): ########## Fails also -
> I try to fill missing entries with something other than 'None'. I do
> not seem to be able to get it to work - any pointers appreciated.
> listb = ['b10', 'b11','b12' ,'b13']
> print "ZIP:", x, "<<x y>>", y
> expected
> print "MAP:", x, "<<x y>>", y
> 'str'
> print "MAP:", x, "<<x y>>", y
> return fillchars
> Can not call a 'str'
> print "MAP:", x, "<<x y>>", y