import json
class MyClass:
def __init__(self, a, b):
self.group = []
self.a = a
self.b = b
def add(self):
c = self.a + self.b
self.group.append(c)
print(self.group)
obj = MyClass(2, 4)
obj.add()
obj.add()
$ python3 test.py
[6]
[6, 6]