← Quiz: Python Lists: all 15 questions
Quiz: Python Lists · Question 14 of 15
What does this print? (code)
What does this print?
grid = [[1, 2, 3], [4, 5, 6]]
print(grid[1][0], len(grid))
- A.4 2
- B.2 2
- C.4 6
- D.1 3
Answer & explanation
Correct answer: 4 2
grid[1] is the second row [4, 5, 6], and its item 0 is 4. The outer list has 2 rows.
Can you get the rest right without peeking?
Take the timed Quiz: Python Lists quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →