How to do multiple arguments to map function where one remains the same in python?
<p>Lets say we have a function add as follows</p>

<pre><code>   def add(x,y):
       return x+y
</code></pre>

<p>we want to apply map function for an array </p>

<pre><code>   map(add,[1,2,3],2)
</code></pre>

<p>The semantics are I want to add 2 to the every element of the array. But the map function requires a list in the third argument as well.</p>

<p><strong>Note:</strong> I am putting the add example for simplicity. My original function is much more complicated. And of course option of setting the default value of y in add function is out of question as it will be changed for every call.</p>

<p>Thanks a lot.</p>
