exec in def python code example
Example: exec inside def is not working in python
def better():
d = {}
exec("x=23", d)
return d['x']
print better()
23
def better():
d = {}
exec("x=23", d)
return d['x']
print better()
23