Python eval() Function
Definition and Usage
The eval() function calculates the specified expression. If the expression is a valid Python statement, it will be executed.
Syntax
eval(expression, globals, locals)
Parameter Value
Parameter | Description |
---|---|
expression | String, which will be evaluated as Python code. |
globals | Optional. A dictionary containing global parameters. |
locals | Optional. A dictionary containing local parameters. |