So, I want to pragmatically create class instances from a list of lists I'm looping over. How to do that?
class foo:
def __init__(self, first, second):
self.first = first
self.second = second
my_list = [[a_0, a_1, a_2], [b_0, b_1, b_2], [c_0, c_1, c_2]]
i = 1
instance_name = instance_
for list in my_list:
x = instance_name + str(i)
x = foo(list[0], list[2])
i += 1
I know that the second x in my loop is totally wrong. But I need to be able to call my instances in the future with the value of x. Any help?