title: Call a function from a stored string in Python
body: <p>What I need is something that gets the variable and if the variable is the name of a function, the function will be called.
  I am not trying to get a function from a module but from within the program itself</p>
  
  <p>Example:</p>
  
  <pre><code>def foo():
      print("Foo")
  callfunction = input("What function do you want to call? ")
  
  callfunction() ## Not sure what to put here but but lets say callfunction is foo.
  </code></pre>
  
  <p>I don't want something like this because I have many functions:</p>
  
  <pre><code>if callfunction == "Foo"
      Foo()
  else:
      print("No function with that name")
  </code></pre>
  
  <p>My question is something like <a href="https://stackoverflow.com/questions/1005857/how-to-call-php-function-from-string-stored-in-a-variable">this</a>, but I ask for the Python syntax. I am using Python 3.5.1</p>