exec and globals and locals ...

Eko palypse ekopalypse at gmail.com
Thu Sep 19 06:59:35 EDT 2019


No, I have to correct myself

x = 5
def f1():
    exec("x = x + 1; print('f1 in:', x)")
    return x
print('f1 out', f1())

results in the same, for me confusing, results.

f1 in: 6
f1 out 5

Eren



More information about the Python-list mailing list