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 in Python?
Think about what a list can hold.
How would you access the second element in the first list of [[1, 2, 3], [4, 5, 6]]?
Remember how indexing works; start counting from zero.
What is a nested list?
Think of what type of data lists can include.
Can you access elements in a nested list using a single index?
Remember how we access items in regular lists.
Create a nested list that represents the following 3x3 grid: X O X, O X O, X O X. Write a function to count how many times 'X' appears.
Use a loop to go through each row.
Create a program that allows the user to input a 2x2 nested list and then print each element in a formatted way.
Think about how to navigate each dimension of the data.
6 more questions in this section. Enroll free to practise them all.
Enroll free