Lists
Class 11 · Computer Science
4 ideas in Class 11 Computer Science, explained in plain words, with games and quizzes to practise.
Creating Lists
Part of: List Basics
Lists hold ordered mixed items in brackets; indexed from zero; mutable; length counts members.
Why it matters. Groups stored. Items reached.
Key words
- List literal
- : Ordered mixed items held in square brackets.
- Zero indexing
- : Position counting from zero for the first item.
- Length
- : The count of members found by the length function.
- Mutability
- : Lists allowing changes after creation.
Try it in two minutes
- Bracket items.
- Index from zero.
- Count length.
Try at home. List your marks.
List Operations
Part of: List Basics
Plus joins lists; times repeats; in checks; loops visit; sum, max, min aggregate.
Why it matters. Lists combined. Values aggregated.
Key words
- Concatenation
- : Joining two lists end to end with the plus sign.
- Repetition
- : Repeating a list with the times sign.
- Membership test
- : Testing membership with the in keyword.
- Traversal
- : Visiting each item in turn with a loop.
- Aggregation
- : Totalling, max and min over list members.
Try it in two minutes
- Join lists?
- Loop members?
- Aggregate values?
Try at home. Sum a list.
Changing Lists
Part of: List Methods
Append adds end; insert places; remove deletes value; pop takes index; sort orders.
Why it matters. Lists edited. Order set.
Key words
- Append
- : Adding one item to the end of a list.
- Insert
- : Placing an item at a chosen position.
- Remove
- : Deleting the first matching value found.
- Pop
- : Taking out the item at a given index.
- Sort
- : Arranging items in rising order in place.
Try it in two minutes
- Add items?
- Remove items?
- Sort items?
Try at home. Edit a list.
Nested and Copy
Part of: List Methods
Lists nest inside lists; tables as rows; copy duplicates; alias shares changes.
Why it matters. Tables built. Copies safe.
Key words
- Nested list
- : Lists placed inside lists, read as rows of a table.
- Alias
- : A second list sharing the same members and changes.
- True copy
- : An independent duplicate shielding the original from edits.
- Double indexing
- : Reach inner items with double indexing like grid rows.
Try it in two minutes
- Nest rows?
- Copy safely?
- Avoid alias?
Try at home. Nest two rows.
What your child will practise
- Changing Lists: Candy Puzzle (Clue Puzzle)
- Changing Lists: Candy Quick Fire (Quick Fire)
- Creating Lists: Desert Puzzle (Clue Puzzle)
- List Operations: Candy Quest (Flip and Match)
- Nested and Copy: Ocean Quick Fire (Quick Fire)
- Quiz: Changing Lists (8 questions)
- Quiz: Creating Lists (8 questions)
- Quiz: List Operations (8 questions)
- Quiz: Nested and Copy (8 questions)