title: How to calculate an equation in a string, python
body: <p>I have a variable that is <code>function = '(2*1)+3'</code>. How would I get it out of string form and calculate the answer? I tried using <code>float()</code>, <code>int(float())</code> but I'm not sure if that's for numbers only or not.</p>