I am new to python recently I am working on a project in I created a class:-
class foo():
def __init__(self, name):
self.name = name
I want to create 50 objects of this class which sholud be named as obj1, obj2, obj3,..., obj50 I am trying to create these classes like
for i in range(1,51):
obj + i = foo(i)
So that 50 objects like obj1, obj2, obj3,..., obj50 are created with names as 1, 2, 3,...,50. But for some reason this is not working for me. Can anyone tell what am I doing wrong here. I know that I can use a list to store the objects but for some reason I would like to do it this way. Any help is highly aprreciated.