I recently looked up this topic but dint find a satisfying answer. Everybody said using dictionaries is the best way , but I don’t know how to apply that in this case:
I want a function that generates me a list of objects generated by a class. So in pseudo-code something like :
for a in range(100):
tmp = "object" + str(a)
var(tmp) = someclass()
list add tmp
Edit , because of being marked as an duplicate.
I don’t want an answer how dictionary work , I know that. I want to know , how I can make entries which consists of an entry-name and the generated objects for that name. I need a dictionary which looks something like: {"1" : obj1 , "2" : obj2, "3" : obj3 ... }
Edit two: I ended up using a list instead of a dictionary which is massively easier:
for tmp in range(100):
tmpobj = objclass()
list.append(tmpobj)
thanks for help ;)