School Revise · Class 11 Computer Science · Chapter 10
Code 083, Class 11. A tuple is a fixed list, and a dictionary stores pairs of keys and values. Here we create and use both.
|
|
A tuple is an ordered collection like a list, but it cannot be changed (it is immutable). A dictionary stores data as key and value pairs, which we look up by the key.
Write a tuple in round brackets, separated by commas. Read items by index, just like a list, but you cannot change them.
|
t = (10, 20, 30) print(t[1]) Output: 20 |
A dictionary holds key and value pairs in curly brackets. We look up a value by its key, and we can add or change pairs.
|
d = {“name”: “Ravi”, “age”: 15} print(d[“name”]) Output: Ravi |
keys() gives all the keys, values() gives all the values, items() gives the pairs, and get(key, default) reads a value safely.
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
Round brackets, ( ).
No, a tuple is immutable.
key and value pairs.
keys().
|
A tuple is an ordered, immutable collection in round brackets, read by index. A dictionary stores key and value pairs in curly brackets, looked up by key; we can add or change pairs. Methods keys(), values(), items() and get() work with dictionaries. |
| Open the Virtual Lab |
These free Class 11 Computer Science notes explain tuples and dictionaries, creating and accessing them, immutability of tuples, and dictionary methods with worked Python programs 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 Computer Science syllabus. Unauthorised copying is not permitted.