class C: def __init__(self, v): self.v = v def i(self, d): self.v = self.v + d s = [C(i) for i in range(1, 4)] s1 = s[1] s1.i(10) print(s)