Vidyalelo
Python · Q147

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 147

Q147

What will be the output of the following Python code? >>>m = [[x, x + 1, x + 2] for x in range(0, 3)]

A.
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
B.
[[0, 1, 2], [1, 2, 3], [2, 3, 4]]
Answer
C.
[1, 2, 3, 4, 5, 6, 7, 8, 9]
D.
[0, 1, 2, 1, 2, 3, 2, 3, 4]

Answer: Option B

Solution

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