|
|
|
|
|
by speedster217
2947 days ago
|
|
I just tested it in Python3: def foo():
exec("a=1")
return a
print(foo())
Fails with a NameError: Traceback (most recent call last):
File "test.py", line 5, in <module>
print(foo())
File "test.py", line 3, in foo
return a
NameError: name 'a' is not defined
|
|