There are 99 different function definitions:
def Fun_1():
...
def Fun_2():
...
def Fun_3():
...
...
...
def Fun_99():
...
The value of the variable x
is randomly obtained between 1 and 99:
x = aleat(0, 99)
The variable NomeFun
is obtained by concatenating "Fun_"
, the value of x
converted to string and "()"
:
NomeFun = "Fun_" + str(x) + "()"
How to code, in Python, the call to the function whose name matches the contents of the variable NomeFun
? It would look something like:
execute(NomeFun) ???