1 | initial version |
You can mention the function names that are saved in a variable as a string by simply using the variable name without parentheses. This will not execute the function but will only refer to it as a string value. For example, if you have a function named "myfunction" that is saved in a variable "funcname" as a string, you can mention it like this:
func_name = "my_function"
print(func_name) # Output: my_function
This will print the string value of the variable "funcname" which is "myfunction". It will not execute the function.