School Revise · Class 11 Informatics Practices · Chapter 4
Code 065, Class 11. A list holds many values in order; a dictionary stores key and value pairs. Here we create and use both.
|
|
A list stores several ordered values and can be changed. A dictionary stores key and value pairs, looked up by the key.
Write a list in square brackets. append() adds, remove() deletes, sort() orders, and len(), sum(), max() work on it.
|
nums = [10, 20, 30] nums.append(40) print(nums) Output: [10, 20, 30, 40] |
A dictionary holds key and value pairs in curly brackets. Look up a value with d[“key”], and add a pair with d[“new”] = value.
You can loop through a list with for, and through a dictionary to read its keys and values. Both are widely used to hold data.
Explore the idea by tapping. The interactive opens right here in the lesson.
Write and run real Python right here in the lesson, then work through the practice problems with answers.
Type each one into the code lab above, then open the card to see the worked solution and its output.
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
Square brackets, [ ].
append().
key and value pairs.
With d[“key”].
|
A list stores ordered values in square brackets and is mutable; append(), remove() and sort() change it, and len(), sum(), max() work on it. A dictionary stores key and value pairs in curly brackets, read by key and extended with d[“new”] = value. Both can be looped through. |
| Open the Virtual Lab |
These free Class 11 Informatics Practices notes explain lists and dictionaries, list methods, dictionary key and value pairs, and looping through them with worked examples and practice, for CBSE students across India and the Gulf including the UAE, Saudi Arabia, Qatar, Oman, Kuwait and Bahrain.
© 2026 School Revise. All rights reserved. Original content aligned to the CBSE and NCERT Class 11 Informatics Practices syllabus. Unauthorised copying is not permitted.