I would like to define a function within a function, and call it from out of the function. Here is a simplified version of my code:
def make_func():
exec('def test(text):\n\tprint(text)')
make_func()
test("Hello")
When I run this code, I get this error:
Traceback (most recent call last):
line 6, in <module>
test("Hello")
NameError: name 'test' is not defined
Thank you in advance for your help.