Skip to content
CCC Python Course

Lists (1D and 2D)

Stage
1
Module
M1.8
Lessons
1

In this module

  • Build and grow a list with a literal, .append(), and a list comprehension.
  • Summarize a list with sum(), sorted(), reversed(), any() and all(), and pair values with enumerate() and zip().
  • Build a 2D grid of lists, and avoid the [[0] * m] * n aliasing bug that shares one row across every entry.
  • Recognize which list operations cost more as a list grows, and allocate n + 1 slots for a 1-indexed problem.

Before this module

Lessons

  1. 1Lists (1D and 2D)

Practice

Try these on the judges. Each link opens the problem on WMOJ or DMOJ.

  1. 2026 J2
    Olympic Scores (opens on WMOJ in a new tab) WMOJ

    Drop an athlete's highest and lowest judge scores, then scale what remains by a difficulty factor.

  2. 2023 J3
    Special Event (opens on WMOJ in a new tab) WMOJ

    Find which day of the week has the most people available from a list of weekly schedules.

  3. 2016 J2
    Magic Squares (opens on DMOJ in a new tab) DMOJ

    Check whether every row and column of a grid sums to the same value.

    Why DMOJ: Tries the same kind of problem on DMOJ, which holds 2014 to 2020.