Im trying to create a more dynamic program where I define a function's name based on a variable string.
Trying to define a function using a variable like this:
__func_name__ = "fun"
def __func_name__():
print('Hello from ' + __func_name__)
fun()
Was wanting this to output:
Hello from fun
The only examples I found were: how to define a function from a string using python