Report Bug

Qus

What will be the output of the following Python code?

  A = [[1, 2, 3],            [4, 5, 6],            [7, 8, 9]]  A[1]
Qusनिम्नलिखित Python कोड का आउटपुट क्या होगा?


A. [4, 5, 6]
B. [3, 6, 9]
C. [1, 4, 7]
D. [1, 2, 3]


Solution
A. [4, 5, 6]



Explanation
We can index the rows and columns using normal index operations. The statement A[1] represents the second row, that is, the middle row. Hence the output of the code will be: [4, 5, 6].
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad