Certified Entry-Level Python Programmer (PCEP-30-02) — Question 5
The fact that tuples belong to sequence types means:
Answer options
- A. they can be modified using the del instruction
- B. they can be extended using the .append() method
- C. they are actually lists
- D. they can be indexed and sliced like lists
Correct answer: D
Explanation
The correct answer is D because tuples, as sequence types, allow indexing and slicing just like lists do. Options A and B are incorrect since tuples are immutable and cannot be modified or extended, and option C is also incorrect as tuples and lists are distinct data types in Python.