Posts by Mateus Vieira • 41 points
2 posts
-
1
votes2
answers1301
viewsA: Calling a Python function by the text present in a variable
Well it seems strange but I managed to solve the problem, for those who have the same problem is very simple : executar = locals() func = 'somar' result1 = executar[func](3, 2) func = 'mult' result2…
pythonanswered Mateus Vieira 41 -
3
votes2
answers1301
viewsQ: Calling a Python function by the text present in a variable
I am new in Python and I would like to know if it is possible to call a function by the text present in a variable, example: I ask the user to enter the name of a function, and save what was typed…
pythonasked Mateus Vieira 41