title: How to store and use mathematical operators as python variable
body: <p>I am new to python and was trying to write something like this below (code A) so it does eactly like code B. I want to make use of user input of mathematical operators as <code>do_what</code> variable. How can we write this code (A) in python so it would work like code B?</p>
  
  <p>code A</p>
  
  <pre><code>num1 = input("Enter a number: ")
  num2 = input("Enter another number: ")
  do_what = input("Enter a calculation symbol for calculation you want to perform: ")
  result = float(num1) do_what float(num2)
  print("result is: " + str(result))
  </code></pre>
  
  <p>code B</p>
  
  <pre><code>num1 = input("Enter a number: ")
  num2 = input("Enter another number: ")
  result = int(num1) + int(num2)
  print("result is: " + str(result))
  </code></pre>