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. (

Comment on Disqus:

Comment on Twitter:

Question difficulty: πŸ”΅πŸ”΅πŸ”΅πŸ”΅πŸ”΅

Similar questions: