What is eval in python?

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)

This is all about eval() in python.
Subscribe
Login
Please login to comment
0 Discussion