Vidyalelo
Python · Q78

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 78

Q78

What will be the output of the following Python code? a=[[]]*3 a[1].append(7) print(a)

A.
Syntax error
B.
[[7], [7], [7]]
Answer
C.
[[7], [], []]
D.
[[],7, [], []]

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board