Answers for "exec inside def is not working in python"

0

exec inside def is not working in python

def better():
    d = {}
    exec("x=23", d)
    return d['x']

print better()
23
Posted by: Guest on August-22-2020

Code answers related to "exec inside def is not working in python"

Python Answers by Framework

Browse Popular Code Answers by Language