A list can contain other lists. A list whose items are all lists of the same length is a convenient way to represent a matrix or grid: a table with rows and columns, such as a game board, a seating plan, a timetable or a small spreadsheet of numbers. Each inner list is one row, and the position within that row is the column. Python has no separate built-in matrix type at PCEP level, so a list of lists is the standard tool, and the exam expects you to index, loop over and build them confidently.
Keep reading for free
Create a free StudyToCert account to read the rest of this lesson: 7 more sections, 6 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.