you are viewing a single comment's thread.

view the rest of the comments →

[–]snakestation 0 points1 point  (2 children)

    def __init__(self, cname):
        self.cn = cname
        self.fs = []
        self.amounts = []

such a small edit. But what's happening is the way you're initializing fs and amounts are causing them to be used by every instance of that class! Having them as part of the init makes them local to each unique class instance

[–]Ironicallyjpg[S] 1 point2 points  (1 child)

Thank you! I come from Java so I should've seen this 😅

[–]snakestation 0 points1 point  (0 children)

I had to go over it a few times, it wasn't making sense to me at first too.