CBSE Class 11 Computer Science Question 74 of 104

List Manipulation — Question 10

Back to all questions
10
Question

Question 10

Predict the output:

a, b, c = [1,2], [1, 2], [1, 2]
print(a == b)
print (a is b)

Answer

Output
True
False
Explanation

As corresponding elements of list a and b are equal hence a == b returns True. a is b returns False as a and b are two different list objects referencing two different memory locations.

Answer