I have written some classes I would like to test by creating multiple instances of my classes. I would like those instances to have names following the pattern p1
, p2
, etc:
p1 = Point(1,1)
p2 = Point(2,2)
p3 = Point(3,3)
Is there a way to do this quickly for a lot of variables? Something like this:
for i in range(1,1000):
*magic goes here*
isinstance(p500, Point) # True