Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is a nested list?
Think about lists within lists.
How would you create a 2D list (matrix) with three rows?
Recall the format of a list within a list.
What are nested lists?
Think about how you can represent more complex data.
True or False: You can access elements in a nested list using multiple indices.
Recall the way we access elements in multi-dimensional arrays.
Create a nested list in Python representing a 3x3 tic-tac-toe board. Write a function to check for a winner.
Think of how to check rows, columns, and diagonals for the same symbols.
Write a Python function that takes a nested list and returns the sum of all numbers within it, regardless of depth. Provide an example call.
Think about how to check each element and whether it's a list to decide how to sum it.
5 more questions in this section. Enroll free to practise them all.
Enroll free