π 2012-May-03 ⬩ βοΈ Ashwin Nanjappa ⬩ π·οΈ eval, python ⬩ π Archive
eval in Python works like in many functional programming languages. It evaluates the input string as if it were a Python expression. Pythonβs eval can only handle expressions, so is pretty limited.
= 1
x = eval( "x + 1" ) # 2
y
= eval( "lambda x: x * x" )
f = f( 10 ) # 100 g
Tried with: Python 3.2