Jump to content

Runtime evaluation: Difference between revisions

(explicitly mention envs)
Line 68:
 
=={{header|Python}}==
The [http://docs.python.org/reference/simple_stmts.html#exec exec statement] allows the optional passing in of global and local names via mappings (See the link for full syntax). The example below shows exec being used to parse and execute a string containing two statements:
{{incorrect|Python|It does not discuss passing in or returning values, or the environment the expression is evaluated in.}}
 
<lang python>>>> exec '''
x = sum([1,2,3,4])
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.