title: Using user input to call functions
body: <p>I was trying to make a "game" in Python where the user inputs a command. However, I do not know whether you can take that input to be a function name. This is my current effort:</p>
  
  <pre><code>def move():
      print("Test.")
  
  if __name__ == "__main__":
      input("Press enter to begin.")
      currentEnvironment = getNewEnvironment(environments)
      currentTimeOfDay = getTime(timeTicks, timeOfDay)
      print("You are standing in the {0}. It is {1}.".format(currentEnvironment, currentTimeOfDay))
      command = input("&gt; ")
      command()
  </code></pre>
  
  <p>Here, the input was move, as I wanted to try and call that function (as a potential end user might). However, I get the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "D:\Text Adventure.py", line 64, in &lt;module&gt;
      command()
  TypeError: 'str' object is not callable
  </code></pre>
  
  <p>I was wondering if there was any way that I could allow a user to 'move' in the game, which the program achieves by calling the "move" function.</p>