1
0/5

The incomplete Python program in Figure 1 is designed to write real-time water temperature values to a 4-by-4 two-dimensional array representing an ocean sensor grid.

Complete the program by identifying the code that should be written in the five blank gaps.

Figure 1

1  temp_grid = [[0.0, 0.0, 0.0, 0.0],
2               [0.0, 0.0, 0.0, 0.0],
3               [0.0, 0.0, 0.0, 0.0],
4               [0.0, 0.0, 0.0, 0.0]]
5
6  r = 0
7  while r < 4:
8
9      c =
10     while c < 4:
11
12         temp_grid[ [ 2 ] ][ [ 3 ] ] = read_sensor()
13
14
15
16
[5]

Data structures Questions

Practise AQA GCSE Computer Science Data structures with exam-style questions for GCSE Computer Science. 37 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

Next

Data structures Questions

  1. GCSE
  2. /Computer Science
  3. /Data structures