1

I'm trying to create a program that edits mathematical formulas (integration to be precise). I have the user input stored as a string to make it easy to edit. However after the equation has been edited I can't solve it

function = '2**3 + 2**4'

This would be an example of the equation to solve, I would like it to be converted into a floating point value ideally.

print(function)

print function should output 24 (2 to the power 3 + 2 to the power 4).

0 Answers0