T Tam ca New member Sep 20, 2021 #1 What will be the output of the following Python code? Code: A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] A[1] A. [4, 5, 6] B. [3, 6, 9] C. [1, 4, 7] D. [1, 2, 3]
What will be the output of the following Python code? Code: A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] A[1] A. [4, 5, 6] B. [3, 6, 9] C. [1, 4, 7] D. [1, 2, 3]
T Thiên Nhạc Tâm New member Sep 20, 2021 #2 Answer: a 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]. Upvote 0 Downvote
Answer: a 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].