MCQ Single Best Answer Not Set

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

ID: #3879 Python for Loop MCQ 296 views
Question Info
#3879Q 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, 4, 5, 6, 7, 8, 9]
  • B [0, 1, 2, 7, 8, 9, 4, 5, 6]
  • C [(0, 1, 2), (7, 8, 9), (4, 5, 6)]
  • D [(0, 7, 4), (1, 8, 5), (2, 9, 6)]
Correct Answer: Option B

Explanation

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

Share This Question

Challenge a friend or share with your study group.