Apr-09-2019, 07:22 PM
Hi all.
I dont quite understand why these two different objects are pointing to the list object? Could anyone please help me understand this?
I dont quite understand why these two different objects are pointing to the list object? Could anyone please help me understand this?
class A:
l = [1]
def __init__(self):
pass
a = A()
a1 = A()
print(id(a.l))
print(id(a1.l))Output:140465203999880
140465203999880Many thanks
