Strings, lists and dictionaries: practice questions
Class 11 Computer Science. Ten questions with step-by-step answers, for CBSE and ICSE. Try each one before you open its answer.
Key ideas
- Working with collections.
- These are the multi-step questions examiners like to set. Read each one twice, write down what you know, then plan before you calculate.
- These go beyond the syllabus. Each one has a neat idea that makes it short; brute force is slow.
Read each question twice and say the answer out loud before you check it. For code or binary questions, work it out on paper step by step, the way a computer would.
Ten questions
1.xs = [22, 13, 6, 12, 1, 16] print(xs[-2])
Show the answer
Think: Count from 0.
Work: Indexes start at 0; −1 is the last item.
Answer: 1
2.d = {"a": 11, "b": 25} d["a"] += 5 print(d["a"] + d["b"])
Show the answer
Think: Look up by key.
Work: Update a, then add.
Answer: 41
3.xs = [25, 2, 29, 14, 3, 3] print(xs[0])
Show the answer
Think: Count from 0.
Work: Indexes start at 0; −1 is the last item.
Answer: 25
4.d = {"a": 33, "b": 23} d["a"] += 5 print(d["a"] + d["b"])
Show the answer
Think: Look up by key.
Work: Update a, then add.
Answer: 61
5.xs = [21, 28, 21, 9, 10, 28] print(xs[0])
Show the answer
Think: Count from 0.
Work: Indexes start at 0; −1 is the last item.
Answer: 21
6.d = {"a": 9, "b": 36} d["a"] += 5 print(d["a"] + d["b"])
Show the answer
Think: Look up by key.
Work: Update a, then add.
Answer: 50
7.xs = [18, 13, 13, 19, 17, 20] print(xs[2])
Show the answer
Think: Count from 0.
Work: Indexes start at 0; −1 is the last item.
Answer: 13
8.d = {"a": 7, "b": 33} d["a"] += 5 print(d["a"] + d["b"])
Show the answer
Think: Look up by key.
Work: Update a, then add.
Answer: 45
9.xs = [12, 10, 15, 1, 20, 22] print(xs[4])
Show the answer
Think: Count from 0.
Work: Indexes start at 0; −1 is the last item.
Answer: 20
10.d = {"a": 12, "b": 46} d["a"] += 5 print(d["a"] + d["b"])
Show the answer
Think: Look up by key.
Work: Update a, then add.
Answer: 63
Before you check an answer
- Count from 0.
- Look up by key.
Questions students ask
- What does Strings, lists and dictionaries in Class 11 Computer Science cover?
- Working with collections. These are the multi-step questions examiners like to set. Read each one twice, write down what you know, then plan before you calculate. These go beyond the syllabus. Each one has a neat idea that makes it short; brute force is slow.
- How should I practise Strings, lists and dictionaries?
- Read each question twice and say the answer out loud before you check it. For code or binary questions, work it out on paper step by step, the way a computer would. Try all ten questions on this page, then open the chapter in Gradient tuition for step-by-step lessons, a live experiment and an AI tutor who explains where you went wrong.
- Is this for CBSE or ICSE?
- The questions follow the Class 11 Computer Science syllabus shared by CBSE and ICSE / ISC, and suit most state boards too.
Stuck on one of these?
Gradient tuition teaches Strings, lists and dictionaries step by step, with experiments you can play with and an AI tutor who circles the part of the question you missed.
Open Strings, lists and dictionaries in tuition