title: python - pass argument to function in a dictionary
body: <p>I've something like a switch, that given an option will call a function e.g. </p>
  
  <pre><code>#... capture option
  op = getOption()
  #.. capture metric
  mt = getMetric()
  
  def zipcode():
      print "You typed zero.\n"
  def desc():
      print "n is a perfect square\n"
  def address():
      print "n is an even number\n"
  
  #call desired option
  options= {0 : zipcode,
            1 : code,
            2 : desc,
            3 : address
  }
  
  options[op]()
  </code></pre>
  
  <p>I am trying to pass a parameter (<strong>mt</strong>) into my <strong>options</strong> dict that will call a function, but i'm not being able to do so.</p>
  
  <p>if op received is 1 and mt is foo, how the call to  the right function (zipcode) will be done by passing mt as a parameter?</p>
  
  <p>ideally: <code>options[op](mt)</code> and defining one parameter in the function?</p>
  
  <p>Thanks</p>