Question #128

What is the output of the code snippet below?
a = []
b = []
print(a is b)

As [] is a mutable object (list), Python creates a new memory address for each object created. As both a and b refer to different objects, they are not considered as the same object by Python. (towardsdatascience.com/assignment-shallow-or-deep-a-story...)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: