Cheat sheet · Class 11 · CBSE · Science Computer Science

Lists cheat sheet

The whole chapter on one page: key formulas, facts and the points to remember, for quick revision before a test.

CBSE Class 11 · Computer Science

Cheat sheet

Chapter 9Lists

Lists are mutable, ordered and can mix types.

1. Basics

  • Created with [ ] or list().
  • Indexing and slicing like strings.
  • Elements can be changed: L[0] = 10.

2. Methods

MethodDoes
append(x)add one item at the end
extend(L2)add all items of L2
insert(i, x)insert at position i
remove(x)remove first x
pop(i)remove and return item i (last by default)
sort(), sorted(L)sort in place / return new list
reverse(), index(x), count(x)reverse, find, count
len(), min(), max(), sum()built-ins

3. Copying & Nesting

  • L2 = L1 makes an alias (same list).
  • L2 = L1.copy() or list(L1) makes a copy.
  • Nested lists: L[i][j].

4. Key Points

  • Lists passed to functions can be changed in place.
  • + joins lists; * repeats.
  • del L[i] deletes by index.
  • Linear search over a list is O(n).

Remember: Mutable | append vs extend | alias vs copy

Lists: questions and notes

More Class 11 · CBSE · Science Computer Science cheat sheets

Practise Lists

Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.

Start practising free

Free to start · No credit card needed