exec() Syntax: 1exec(object[, globals[, locals]]) 2 3:param object: As already said this can be a string or object code 4:param globals: This can be a dictionary and the parameter is optional 5:param locals: This can be a mapping object and is also optional eg.
1from math import * 2exec("print(factorial(5))", …