Lompat ke konten

Lesson 30: Car park map

English

A map in a list

  • The robot drives over a small car park and writes down which spaces have a car.
  • One row of spaces is a list: [1, 0, 1, 0]. The whole car park is a list of lists, a 2D list (in the exam: a 2D array).
  • Then the program uses the map to find the busiest row.

Words for this lesson

Word Meaning
2D list a list of rows; each row is a list
row / column across / down
index the place number; Python starts at 0
nested loop a loop inside a loop

Masuk atau buat akun

IGCSE, A-Level & AP