Worksheets › Class 9 › Python Lists
Class 9 · Computational Thinking and AI worksheetPython Lists
CBSE Computational Thinking and AI. Indexing and negative indexing, slicing, append, insert, remove, pop, extend and sort, len, sum, max and min. Every sheet has 20 questions in three sections and an answer key, and the questions change every time.
Sample questions
Real questions from this chapter, as the app sets them. Tap Answer to see the answer and working.
Section A · multiple choice
- 1.
The first item of a Python list has index:
- −1
- it has no index
- 1
- 0
Answer
(d) 0
- 2.
What does this print? a = [78, 81, 73, 55, 75, 72] print(a[4])
- 55
- 72
- 75
- 4
Answer
(c) 75
indexes start at 0: a[4] is item 5
- 3.
What does this print? a = [16, 38, 14, 59, 3] print(a[-4])
- 59
- 3
- 38
- 16
Answer
(c) 38
a[-4] counts 4 from the end
Section B · short answer
- 4.
What is a list in Python? Give an example.
Answer
An ordered collection of items in square brackets, e.g. marks = [78, 92, 65].
- 5.
For a = [27, 35, 90, 64, 61, 67, 65], what are (a) a[6] (b) a[-4]?
Answer
(a) 65; (b) 64
indexes start at 0; negative indexes count from the end
Section C · long answer
- 6.
Create a list of children selected for a quiz, then delete one name, add one at the end and remove the item at the second position. Explain each step.
Answer
q = ["Arjun", "Isha", "Kabir", "Meera"]; q.remove("Kabir"); q.append("Jay"); q.pop(1) removes the item at index 1; print(q).
Fresh sheets for your child
In the app, every Python Lists sheet is new: the app remembers the questions your child has already had and leaves them out. Print the sheet as a PDF, or use notebook mode and write the answers in a notebook.
Coming soon for Android and iPhone.