Menu

Two-dimensional Arrays (2D Lists) - Code Quiz

1. What is printed by this code?

marks = [[12, 14, 8], [6, 8, 5], [16, 15, 9]] print(marks[1][2])
9
5
15
8

2. What is the value of total when the code has finished?

grid = [[1, 2], [3, 4], [5, 6]] total = 0 for row in grid: for item in row: total = total + item print(total)
9
15
21
6

Log in or sign-up to access the quiz



Don't have a login?

You can still revise this topic