Exec Inside Def не работает в Python
def better():
d = {}
exec("x=23", d)
return d['x']
print better()
23
Sparkling Sable
def better():
d = {}
exec("x=23", d)
return d['x']
print better()
23