adplus-dvertising
frame-decoration

Question

What will be the output?
>>>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]].

c.

[1, 2, 3, 4, 5, 6, 7, 8, 9].

d.

[0, 1, 2, 1, 2, 3, 2, 3, 4].

Posted under Python

Answer: (b).[[0, 1, 2], [1, 2, 3], [2, 3, 4]].

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output?