Lists & Tuples · Question 1 · Easy

What does this slice of the list marks print?

marks = [72, 85, 90, 64, 58]
print(marks[1:4])
  1. [72, 85, 90, 64]
  2. [85, 90]
  3. [85, 90, 64]
  4. [85, 90, 64, 58]
Answer and explanation

Answer: C. [85, 90, 64]

Explanation: The slice starts at index 1 and stops before index 4, so it takes indexes 1, 2 and 3. Those values are 85, 90 and 64.

Next: One value is appended and another inserted at the front of a list. What is…

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