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.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad