Skip to content
CCC Python Course

Imports and the standard library tour

Stage
1
Module
M1.13
Lessons
1

In this module

  • Bring in a module, or one name from it, with import and from ... import.
  • Use math.gcd, math.comb, collections.Counter and itertools.combinations to replace hand-written loops.
  • Read a function's entry in the Python docs before using it.
  • Recognize a mistyped import as a ModuleNotFoundError.

Before this module

Lessons

  1. 1Imports and the standard library tour

Practice

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

  1. 2024 J3
    Bronze Count (opens on WMOJ in a new tab) WMOJ

    Find the third-highest distinct score from a list of contest scores.

  2. 2016 S1
    Ragaman (opens on DMOJ in a new tab) DMOJ

    Decide whether one word, with wildcards, can be rearranged into another.

    Why DMOJ: A short Senior problem, included here for extra practice.