Lists & Tuples · Question 4 · Easy

Three facts about a tuple of scores are printed. What is the output?

t = (4, 5, 6)
print(len(t), t[-1], sum(t))
  1. 3 6 15
  2. 3 4 15
  3. 2 6 15
  4. 3 6 456
Answer and explanation

Answer: A. 3 6 15

Explanation: The tuple has 3 elements, t[-1] is the last element 6, and sum adds them: 4 + 5 + 6 = 15.

Previous: Which expression creates a tuple containing the single element 7? · Next: A list is appended to another list. What length does this print?

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