def my_func(arg):
...
x = foo(var_arg)
...
With many variables saved as var_1
, var_2
, var_3
I would be able to pass one of them based on the foo function's argument. So if I call my_func(2)
, in the function x
will equal the result of foo(var_2)
. Is it possible to construct a variable name like you would with strings?