Multiple assignment using map function
<p>Is it possible to apply map functions to multiple values at once? </p>

<p>Something like this</p>

<pre><code>from collections import defaultdict
d['a'] = [1,2,3,4]
d['b'] = [4,5,6,7]
d['a'], d['b'] = map(lambda x,y: (x,y) if x*y % 3 == 0 else (0,0), d['a'], d['b'])
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
&lt;ipython-input-129-5191c9205e6f&gt; in &lt;module&gt;()
----&gt; 1 d['a'], d['b'] = map(lambda x,y: (x,y) if x*y % 3 == 0 else (0,0), d['a'], d['b'])

ValueError: too many values to unpack
</code></pre>

<p>It is of course possible to do this individually. </p>

<pre><code> l = map(lambda x,y: x if x*y % 3 == 0 else 0, d['a'],d['b'])
 m = map(lambda x,y: x if x*y % 3 == 0 else 0, d['b'],d['a'])
 d['a'] = l
 d['b'] = m

 d
 defaultdict(&lt;type 'list'&gt;, {'a': [0, 0, 3, 0], 'b': [0, 0, 6, 0]})
</code></pre>
