python3.3で:
x = 1
print('global x =', x)
def f():
exec('x=2')
#x = 2
print('local in f() x =', x)
def g():
print('local in g() x =', x)
g()
f()
python3.3では、なぜresulsがこのようになるのですか:
global x = 1
local in f() x = 1
local in g() x = 1
なぜ exec('x=2') in not equal x=2 か教えてください
'x=2' と exec('x=2') の違いは何ですか?
3倍