Back to Freecodecamp

2D Lists and Nested Loops

curriculum/challenges/english/blocks/dictionaries-and-loops/2d-lists-and-nested-loops-video.md

latest391 B
Original Source

--description--

In this video, you will learn how to create 2D lists and use nested loops to work with multi-dimensional data structures.

--questions--

--text--

What will be the output for the following code?

python
number_grid = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
]

print(number_grid[2][1])

--answers--

8


7


9


1

--video-solution--

1