Using a function defined in an exec’ed string in Python 3 [duplicate]
Note: exec was just a Simple statement in Python 2.x, whereas it is a function in Python 3.x. Python 2.7 Let us check the changes made by executing a. class Test: def __init__(self): l, g = locals().copy(), globals().copy() exec a # NOT a function call but a statement print locals() == l, globals() == g … Read more