title: In Python want to use user input as function call
body: <p>In Python I want to use user input as a function call. In particular, I have the following code I'm testing out:</p>
  
  <pre><code>def forward(forwardValue):
      print("in forward, with value " + forwardValue)
      return
  
  command = 'forward'  # this would come in as user input
  value = '255'
  command(value)
  </code></pre>
  
  <p>What I would like to see is a printout that says: in forward, with value 255</p>
  
  <p>What I do see is an error that: </p>
  
  <pre><code>'str' object is not callable
  </code></pre>
  
  <p>That error message makes sense, and I can see why what I tested doesn't work, but is there any way to do what I want to do? In other words, can user input be used as a function call? </p>
  
  <p>What I do currently instead is use an "if" statement to check if the user input is the 'forward' statement, and if so to call the function 'forward'. But I would like to be more Pythonesque if possible. </p>
  
  <p>I have a list of about 30 different commands the user can use, each of which commands has a defined function to handle it. My series of 30 "if" and "elif" statements seems clumsy.</p>