title: Passing multiple arguments (other than data) to imap function for multiprocessing in Python
body: <p>I am working on a simple multiprocessing program in python where I am passing a dataset where each pair of the list will return the multiplication of them. But when I am trying to pass a string along with the dataset to specify the operation (basically if I pass 'add' it will add the pair of numbers and if I pass 'sub' then it will subtract the pair of numbers) then I am facing all kinds of errors. I tried to use the concept of partial function also but it was not that helpful. Here I am attaching my basic code if anybody can help me to modify the code then it will be a great help</p>
  <pre><code>import multiprocessing as mp
  
  data=([1,2],[2,3],[3,4],[4,5],[5,6],[1,2],[2,3],[3,4],[4,5],[5,6],[1,2],[2,3],[3,4],[4,5],[5,6],[1,2],[2,3],[3,4],[4,5],[5,6],
  [1,2],[2,3],[3,4],[4,5],[5,6],[1,2],[2,3],[3,4],[4,5],[5,6],[1,2],[2,3],[3,4],[4,5],[5,6],[1,2],[2,3],[3,4],[4,5],[5,6]
  ,[1,2],[2,3],[3,4],[4,5],[5,6],[1,2],[2,3],[3,4],[4,5],[5,6],[1,2],[2,3],[3,4],[4,5],[5,6])
  
  def mul(x,y):
     return(x*y)
  
  def data_param(data):
      return mul(data[0],data[1])
  def pool_handler():
      #p1=input('enter plus/mul: ')
      p=mp.Pool(3)
      
      out=p.imap(data_param,data)
      for i in out:
          print(f&quot;output: {i}&quot;)
  if __name__ == '__main__':
      pool_handler()
  
  </code></pre>
  <p>Thank you in advance</p>