Python Language Evaluating an expression with eval


Example

>>> expression = '5 + 3 * a'
>>> a = 5
>>> result = eval(expression)
>>> result
20