I was wondering if there is a way that you can make a class instance by using concatenation.
(setting a class name like person1
, person2
, etc... , automatically)
I tried to make a code like:
class ID:
def __init__(self):
self.price = 2000
for i in range(50):
string = person + str(i)
string = ID()
But for some reason it didn't work.
Why can't this be defined this way?
Is this even possible?