Curriculum
Course: Grade XI Computer Science
Login
Text lesson

Le-9 Lists

School Revise · Class 11 Computer Science · Chapter 9

Lists

Code 083, Class 11. A list holds many values in order, and it can be changed. Here we create lists, read and change items, and use list methods.

[]

a list in brackets

yes

lists are changeable

What this chapter is about

A list stores several values in order, inside square brackets. Unlike a string, a list is mutable, so we can add, change and remove items.

1. Creating and reading

Write a list in square brackets, separated by commas. Index it like a string: the first item is at 0. A slice reads part of the list.

nums = [10, 20, 30] print(nums[0], nums[-1]) Output: 10 30

2. Changing a list

Lists can change. append() adds to the end, insert() adds at a position, remove() deletes a value, and pop() removes by index.

3. Useful list functions

len() counts items, sum() adds numbers, max() and min() find the largest and smallest, and sort() arranges the list. The word in checks membership.

Practise with the interactive

Explore the idea by tapping. The interactive opens right here in the lesson.

Try it in the code lab

Write and run real Python right here in the lesson, then work through the practice problems with answers.

Starting Python...

Coding practice problems, with answers

Type each one into the code lab above, then open the card to see the worked solution and its output.

Problem 1. Create a list and print it.

SOLUTION

nums = [10, 20, 30] print(nums)

OUTPUT

[10, 20, 30]
Problem 2. Print the first item of a list.

SOLUTION

fruits = [“apple”, “mango”] print(fruits[0])

OUTPUT

apple
Problem 3. Append an item to a list.

SOLUTION

nums = [1, 2] nums.append(3) print(nums)

OUTPUT

[1, 2, 3]
Problem 4. Find the sum of a list.

SOLUTION

print(sum([2, 4, 6]))

OUTPUT

12
Problem 5. Find the largest item.

SOLUTION

print(max([3, 9, 5]))

OUTPUT

9
Problem 6. Sort a list.

SOLUTION

nums = [3, 1, 2] nums.sort() print(nums)

OUTPUT

[1, 2, 3]
Problem 7. Find the length of a list.

SOLUTION

print(len([1, 2, 3, 4]))

OUTPUT

4
Problem 8. Loop through a list.

SOLUTION

for x in [1, 2, 3]: print(x)

OUTPUT

1 2 3
Problem 9. Remove an item from a list.

SOLUTION

nums = [1, 2, 3] nums.remove(2) print(nums)

OUTPUT

[1, 3]
Problem 10. Check if a value is in a list.

SOLUTION

print(5 in [1, 5, 9])

OUTPUT

True

Practice set A, multiple choice

1. A list is written inside which brackets?

Square brackets, [ ].

2. Which method adds an item to the end of a list?

append().

3. Are lists mutable?

Yes, a list can be changed after it is made.

4. What does sum([2, 4, 6]) give?

12.

Quick summary

A list stores several ordered values in square brackets and is mutable. Index it from 0, and slice it like a string. append() and insert() add items, remove() and pop() delete them. len(), sum(), max(), min() and sort() work on lists, and in checks membership.

Open the Virtual Lab

These free Class 11 Computer Science notes explain lists, creating and indexing, list methods append insert remove and pop, and functions like sum max and sort 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.

Layer 1
Login Categories