wondering if there's any way to run a certain function based off the arguments we give an object. For example, if we pass 1, it will run function_1, but if we pass 2 it will run function_2. Like so:
class my_Class:
def func(self, num):
self.__dict__[f"func_{num}"](num)
def func_1(self, num):
print("test", num)
def func_2(self, num):
print("test", num)
class_obj = my_Class()
class_obj.func(1)
class_obj.func(2)
The output I'd want here is:
test 1
test 2