python
[Python] Eval() function
# The eval() method parses the expression passed to this method
# and runs python expression (code) within the program.
x = 1
print(eval('x + 1'))
Output
2
Was this helpful?
Similar Posts
- Function argument unpacking in Python
- [Python] Range - standard function to create a list of numbers
- [Python] Function returns multiple values
- [Python] Function parameters - pack and unpack
- [Python] Get nodeid, module, function name using Pytest request built-in fixture
- [Python] Default value of function argument
- [Python] Using inspect.stack() to get module name, path, function name