Ever since I've learned the basics of Python classes I've had a single question on my mind: How do you automate the creation of objects instead of having to type test1 = class(example, test)
every time? I've tried using a static function within the class to create the function as such:
class test:
num_of_t = 0
coomers = []
def __init__(self, tes, t):
self.test = tes
self.t = t
test.num_of_t += 1
@staticethod
def creat():
example_input = input("test:")
example_input2 = input("test2:")
test.coomers.append("test_{}".format(test.num_of_t))
for x in test.coomers:
x = test(example_input, example_input2)
def starter():
while y<10:
y += 1
test.creat()
What the program is supposed to do is create 10 objects "test_1, test_2, test_3, etc" respectively with their own values for tes and t because of the 2 inputs.
My problem is in x = test(example_input, example_input2)
as it won't create the class as one would by typing test_1 = test(3, 7)