title: Python: Would it be possible to call a function specifying by string variable?
body: <p>Given there is a list of function's names as strings, would it be possible to call corresponding function with random sampling from the list? Currently I am hard coding all the name by <code>if</code> statement so that</p>
  <pre class="lang-py prettyprint-override"><code>def a(x):
      print(x)
  
  def b(y):
      print(y)
  # there are more functions
  
  func_list = ['a', 'b', ...] # all function's names are stored
  
  chosen_function = random.choice(func_list)
  if chosen_function == 'a':
      a(1)
  elif chosen_function == 'b':
      b(2)
  # elif continues...
  </code></pre>
  <p>I want to eliminates all if statements so that whenever I add new functions in <code>func_list</code>, I do not need to modify the if statements.</p>
  <p>However, I can not contain the function itself in the list as the actual functions have randomness in them so I need to call it after the function is sampled.</p>