You are here : python_3Built-in Functionseval

eval() - Built-in Functions

The arguments are a string and optional globals and locals.  If provided,
globals must be a dictionary.  If provided, locals can be any mapping
object.


Syntax

eval(expression, globals=None, locals=None)


Example

>>> x = 1
>>> eval('x+1')
2


Output / Return Value


Limitations


Alternatives / See Also


Reference