I tried following instructions:
>>> values ['9', '31', '32']
>>> map('abc'.join, values)
and got:
['9', '3abc1', '3abc2']
but i expected:
['abc9', 'abc31', 'abc32']
why am i mistaken?
Just for the record i circumvented it with:
>>> map(lambda x: 'abc%s' % x, values)
But i’m still puzzled by the behaviour of the 1st map-construct!
Thanks for all the insightful answers. They are all correct and helpful, so i had to threw the dice to choose which to accept – i would have accepted any of them 😉
This will call subsequently
which gives
'9'since there is only one element in the given argument tojoin, thensince
'31'is similar to['3', '1']the result is'3abc1'and so on.