title: Want to enter one variable equation in to program in python
body: <p>Is it possible to enter equations in to python program. As an example if I have set equations as below. Is it possible to enter those equations as a user input using input command.</p>
  
  <pre><code>  ex:  1/x - 5/a + 2x^2           (a is a constant value)
         1/x + 10x/a^2 - x^2/a^3 + 3x^2
       (all equations have one variable 'x')
  </code></pre>
  
  <p>I now how to define equation using following command. But I want to input that equation as user input. </p>
  
  <pre><code>def my_function(x):
          return(1/x + r^2/a -5x^2)
  
  my_function(value for x)
  </code></pre>
  
  <p>Because I want to solve each equation for longer range of x value.
  I can write separate program for each equation. But I prefer to give the equation as user input.</p>
  
  <p>Can any one give me a direction to go?</p>