I'm have a class that has many different functions and I want to run all the functions with a loop
Some example code
class a:
def one():
return "one"
def two():
return "two"
b = ['one', 'two']
c = []
for i in b:
c.append(exec("a." + i + "()"))
print(c)
# output: [None, None]
I want the output of a.i() to be concatenated to the variable c but it isn't working because exec is just running that part of code, it's not returning the output. How do I make it so I can store it in a variable?