What is the output? a = [1, 2, 3]
What is the output?
a = [1, 2, 3]
b = a
b.append(4)
print(a)
Show answerHide answer
Correct answer: (B) [1, 2, 3, 4]
Explanation
b and a refer to the same list object.
Correct answer: (B) [1, 2, 3, 4]
Explanation
b and a refer to the same list object.
This is question 142 of DSSSB TGT Computer Science Full Mock Test 3. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.