I have a maybe silly question. Let's take the example below.
class Myclass():
def __init__(self):
pass
def function_1(self):
print("1")
def function_2(self):
print("2")
variable = "1"
if variable == "1":
Myclass().function_1()
if variable == "2":
Myclass().function_2()
Would it be possible to replace the "if" conditions with something like:
Myclass().function_{0}().format(variable)
If yes, how ?