LogiQuest
Back to Comprehensions and Generators
17

What is the output of the following code?

matrix = [[1, 2], [3, 4]]
print([row[i] for i in range(2) for row in matrix])
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.