Vidyalelo
Python · Q48

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 48

Q48

What will be the output of the following Python code? l=[[1 ,2, 3], [4, 5, 6], [7, 8, 9]] [[row[i] for row in l] for i in range(3)]

A.
Error
B.
[[1, 4, 7], [2, 5, 8], [3, 6, 9]]
Answer
C.
1 4 7
2 5 8
3 6 9
D.
(1 4 7)
(2 5 8)
(3 6 9)

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board