Python Programming - Tricky Questions - Discussion
Discussion Forum : Tricky Questions - General Questions (Q.No. 44)
44.
What is the output of the following Python code?
x = [1, 2, 3]
y = x
x += [4, 5]
print(y)
Answer: Option
Explanation:
The
+=
operator modifies the list in-place, and y
reflects this change.
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