I have created a class and created 3 different objects from it. But when I do a change in one of them, other objects get affected too.
I'm running python on pycharm
class Teller():
def __init__(self,queue=[]):
self.queue = queue
teller1 = Teller()
teller2 = Teller()
teller1.queue.append(5)
print(teller1.queue)
print(teller2.queue)
I expected the results as [5]
and [0]
but instead, I get [5]
and [5]