>>>
exec
(
"x=3"
)
>>>
x
3
>>>
def
foo
(
)
:
...
exec
(
"blah=4"
)
...
print
(
blah
)
...
>>>
foo
(
)
Traceback
(
most recent call last
)
:
File
"<stdin>"
,
line
1
,
in
<
module
>
File
"<stdin>"
,
line
3
,
in
foo
NameError
:
global
name
'blah'
is
not
defined