Evaluate string : Eval : Buildin Function PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Function » Eval »

 

Evaluate string


areaStr = "pi*(radius*radius)"


print "nArea = " + str(eval(areaStr, {"pi":3.14}{"radius":5}))



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Function
» Eval