eval Function¶
The eval() function evaluates the specified expression (code), and runs it. The syntax is as below
| Parameter | Description |
|---|---|
| expression | A String that will be evaluated as Python expression |
| globals (Optional) | A dictionary that holds global parameters |
| locals (Optional) | A dictionary that holds local parameters |
Let's drop the extra quote.
The following performs the specified operations:
Let's transfer a dictionary of functions and simply choose from it.