How do you access the element in the second row and third column of a 2D list `matrix`?
Python 2D Lists Quiz

Quiz
•
Computers
•
10th Grade
•
Medium
Danielle Mills
Used 16+ times
FREE Resource
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
`matrix[1][2]`
`matrix[2][3]`
`matrix[2][1]`
`matrix[3][2]`
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you modify the value of the first element in the first row of a 2D list `matrix` to 5?
`matrix[0][0] = 5`
`matrix[1][1] = 5`
`matrix[0] = 5`
`matrix = 5`
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of the following is the correct way to iterate over each element in a 2D list `matrix` using nested loops?
`for i in matrix:
for j in i:
print(j)`
`for i in range(len(matrix)):
for j in range(len(matrix[i])):
print(matrix[i][j])`
`for i in matrix:
print(i)`
`for i in range(matrix):
for j in range(i):
print(matrix[i][j])`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet if `matrix = [[1, 2], [3, 4]]`? ```python print(matrix[1][1]) ```
`1`
`2`
`3`
`4`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid 2D list in Python?
`[[1, 2, 3], [4, 5], [6]]`
`[[1, 2], 3, [4, 5]]`
`[[1], [2, 3], 4]`
[[1] [2] [3]]
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you add a new row `[5, 6, 7]` to an existing 2D list `matrix`?
`matrix.append(5, 6, 7)`
`matrix.append([5, 6, 7])`
`matrix += [5, 6, 7]`
`matrix.insert(len(matrix), [5, 6, 7])`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What error is raised when trying to access an element in a 2D list with an index that is out of range?
`IndexError`
`KeyError`
`TypeError`
`ValueError`
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
Creating and Altering Data Structure

Quiz
•
9th - 12th Grade
20 questions
8525 AQA GCSE 3.2.6 Data Structures

Quiz
•
10th Grade
14 questions
iGCSE CS - Printers

Quiz
•
9th - 10th Grade
15 questions
Python End of Topic Quiz

Quiz
•
8th Grade - University
15 questions
Python Unit 8 Quiz

Quiz
•
9th - 12th Grade
20 questions
Python - lists,loops,basics

Quiz
•
9th - 11th Grade
15 questions
Bài 22-Kiểu dữ liệu danh sách

Quiz
•
10th Grade
20 questions
مراجعة عامة على المنهج – الجزء الأول

Quiz
•
10th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University