I need to make multiple instances of a class, then use its methods to find the output. It is straightforward to write the code in multiple lines but I need a more efficient way of doing that. Basically, here is what I want to do in a loop:
class test(object):
...
def job(self,x='hi',y=4):
return y+len(x)
A1 = test()
y1 = A1.job(x = 'word_1',y=12)
A2 = test()
y2 = A2.job(x = 'word_2',y=5)
A3 = test()
y3 = A3.job(x = 'word_3',y=-12)
A4 = test()
y4 = A4.job(x = 'word_4',y=1)
A5 = test()
y5 = A5.job(x = 'word_5',y=120)
A6 = test()
y6 = A6.job(x = 'word_6',y=-1)
A7 = test()
y7 = A7.job(x = 'word_7',y=10)