MCQ Single Best Answer Not Set

QWhat 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)

ID: #3882 Python List MCQ 226 views
Question Info
#3882Q ID
Not SetDifficulty
Python List MCQTopic

Choose the Best Option

Click any option to instantly check if you're 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: Option B

Explanation

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

Share This Question

Challenge a friend or share with your study group.