CLASS 11 COMPUTER SCIENCE
Chapter: List Manipulation (Python)
1. What is a List?
A list is a collection of elements enclosed in square brackets []. Lists are ordered, mutable, and
allow duplicate values.
2. Creating a List
marks = [80, 75, 90, 85]
3. Accessing Elements
marks[0] → 80
marks[-1] → 85
4. Slicing
marks[1:3] → [75, 90]
5. List Operations
Concatenation (+), Repetition (*), Membership (in, not in)
6. Important List Methods
append(), insert(), remove(), pop(), sort(), reverse(), count(), index()
7. Built-in Functions
len(), max(), min(), sum()
8. Sample Program: Find Average
nums = [10, 20, 30, 40]
avg = sum(nums)/len(nums)
print(avg)
Output: 25.0
9. Nested Lists
matrix = [[1,2,3],[4,5,6]]
matrix[1][2] → 6
10. Practice Questions
1. Find largest element in list
2. Remove duplicate values
3. Reverse a list without using reverse()
4. Count frequency of elements
5. Search an element in a list