+ 3
What does eval function do in python?
7 Antworten
+ 5
it returns eval("2*3*4")
+ 4
It does something similar to what interpreter do. It executes the given statement inside the method.
+ 3
shreyash joshi in your code
e variable is the string type .you can check it by like print(e) or print(type(e)) and eval just executing it.go line by line you can easily understand it.
+ 2
evaluate what is the result of the string
+ 2
"3+3" -> 6
+ 2
Then what does this code do?
def f(r):
j=range(r)
e=eval("*".join([str(i+2)for i in
j]))
return e
print(f(3))
0
deserialize ur code