Lists & Tuples · Question 13 · Medium

A marks table is stored as a list of rows. What does this print?

m = [[1, 2, 3], [4, 5, 6]]
print(m[1][0], len(m), len(m[0]))
  1. 2 2 3
  2. 4 3 2
  3. 4 2 3
  4. 4 2 6
Answer and explanation

Answer: C. 4 2 3

Explanation: m[1] is the second row [4, 5, 6] and its element at index 0 is 4. len(m) counts the rows, 2, and len(m[0]) counts the items in the first row, 3.

Previous: For the tuple t = (1, 2, 3), which of these operations is NOT allowed? · Next: Kavya has a list a and wants b to be a separate list with the same items, so…

Practise lists & tuples

Try a fresh set of lists & tuples questions with an explanation after every answer, free and without signing up: Lists & Tuples practice. Or sit a full placement mock test.

More lists & tuples questions

More python practice

Dictionaries & Sets · Conditions & Loops · Functions & Scope · Comprehensions & Generators · Classes & Objects · Exceptions & Files · Built-ins & Standard Library · Variables, Types & Operators

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge