title: Python 3: Making a str object callable
body: <p>I have a Python program that takes user input. I store user input a string variable called "userInput". I want to be able to call the string the user entered...</p>
  
  <pre><code>userInput = input("Enter a command: ")
  userInput()
  </code></pre>
  
  <p>From this, I get the error: TypeError: 'str' object is not callable</p>
  
  <p>Currently, I have the program doing something like this:</p>
  
  <pre><code>userInput = input("Enter a command: ")
  if userInput == 'example_command':
      example_command()
  
  def example_command():
       print('Hello World!')
  </code></pre>
  
  <p>Clearly this isn't a very efficient way to process a lot of commands.
  I want to make the str obj callable - anyway to do so?</p>