MCQ Practice Single Best Answer Topic: Python List MCQ

Q What will be the output after the following statements?
a = []
b = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]]
for i in range(4):
    a.append([row[i] for row in b])
print(a)

Question ID
#3882
Subchapter
Python List MCQ
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  • B [[0, 4, 8], [1, 5, 9], [2, 6, 10], [3, 7, 11]]
  • C [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11]]
  • D [0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]
Correct Answer: B

Explanation

[[0, 4, 8], [1, 5, 9], [2, 6, 10], [3, 7, 11]]

Share This Question

Share this MCQ with your friends or study group.