Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement