Python Programming - Tricky Questions - Discussion
Discussion Forum : Tricky Questions - General Questions (Q.No. 41)
41.
What is the output of the following Python code?
a = [1, 2, 3]
b = a
a = a + [4, 5]
print(b)
Answer: Option
Explanation:
The concatenation creates a new list, and
b
still refers to the original list.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers