Class 9 Computer Science: Lists & Tuples

Answer the questions and tap Submit to see your score. Your progress is auto-saved on this device.

Jump to question
Q1 · MCQ · 1 mark
What is the primary difference in mutability between Python lists and tuples?
Q2 · MCQ · 1 mark
Which of the following methods can be used to add an element to the end of an existing list?
Q3 · MCQ · 1 mark
Given a tuple `t = (1, 2, 3)`, what will `t[1:3]` evaluate to?
Q4 · MCQ · 1 mark
Which of the following statements is true regarding nested lists and nested tuples?
Q5 · MCQ · 1 mark
Consider the code: `my_list = [5, 2, 8, 1, 9]`. What will `my_list.sort()` do to `my_list`?
Q6 · FILL · 1 mark
To remove a specific element from a list, you can use the `____` method if you know its value, or `____` if you know its index.
Q7 · FILL · 1 mark
When a tuple contains mutable elements like lists, the tuple itself is immutable, but the mutable elements within it can still be `____`.
Q8 · FILL · 1 mark
List slicing `my_list[start:end]` extracts elements from `start` up to, but not including, the element at index `____`.
Q9 · SHORT · 2 marks
Explain why tuples are generally preferred over lists for storing heterogeneous data that should not change throughout the program's execution.
Q10 · SHORT · 2 marks
Describe a scenario where using the `extend()` method on a list would be more appropriate than using the `append()` method.
0 of 10 answered0%