Home / Engineering / Problem Solving and Python Programming / Question

M

Mr. Dubey • 51.32K Points
Coach

Q.) ] for row in (0, 1, 2)]

(A) [7, 8, 9]
(B) [4, 5, 6]
(C) [2, 5, 8]
(D) [1, 4, 7]
Correct answer : Option (C) - [2, 5, 8]

Explanation:
 to get a particular column as output, we can simple iterate across the rows and pull out the desired column, or iterate through positions in rows and index as we go. hence the output of the code shown above is: [2, 5, 8].

Share

Discusssion

Login to discuss.