What is the use of "eval()" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the use of "eval()"

In python E.g input(eval())

16th Apr 2020, 9:00 PM
chigbu chiamaka
chigbu chiamaka - avatar
1 Answer
+ 1
I think to write an example: eval("10 + 20") print(eval) # 30 If you use eval(input("")), you'll can resolve a mathematical works "eval is a built-in- function used in python, eval function parses the expression argument and evaluates it as a python expression. In simple words, the eval function evaluates the “String” like a python expression and returns the result as an integer."
16th Apr 2020, 9:13 PM
LoCoding
LoCoding - avatar