Single Choice Not Set

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

ID: #3881 Python for Loop MCQ 366 views
Question Info
#3881Q ID
Not SetDifficulty
Python for Loop 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

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.