1

I want to create a list of objects who's names are derived from the stage of the loop it's in. This is kind of what im getting at:

for i in range(0,10):
    "object_"+str(i)= i+12
print(object_2)

But this returns the error: SyntaxError: can't assign to operator.

Would this be something that we could do? or would we not be able to call objects created in the loop from outside the loop?

Qwertford
  • 1,039
  • 2
  • 14
  • 25

0 Answers0