Report Bug
Qus :

What will be the output of the following Python code?

 word1="Apple"
word2="Apple"
list1=[1,2,3]
list2=[1,2,3]
print(word1 is word2)
print(list1 is list2)

Qus

निम्नलिखित Python कोड का आउटपुट क्या होगा?

 word1="Apple"
word2="Apple"
list1=[1,2,3]
list2=[1,2,3]
print(word1 is word2)
print(list1 is list2)


A. True True
B. False True
C. False False
D. True False


Solution
D. True False



Explanation
In the above case, both the lists are equivalent but not identical as they have different objects.



Report Bug