🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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))
  1. A.4 2
  2. B.2 2
  3. C.4 6
  4. 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 →