What is eval in python?
![](https://pythonpoint.net/wp-content/uploads/2020/12/Yellow-and-Pink-Beauty-and-Fashion-Blog-Banner-4-1024x576.jpg)
The eval() function evaluates the specified expression, if the expression is a legal Python statement, it will be executed.
syntax:-
eval(expression, global(optional), local(optional))
e.g.,
x=4 s=eval('x==4') print(s)
![](https://pythonpoint.net/wp-content/uploads/2020/12/Screenshot-1157-1024x158.png)
This is all about eval() in python.
Subscribe
Login
Please login to comment
0 Discussion