Skip to content
CCC Python Course

Integer arithmetic and operators

Stage
1
Module
M1.2
Lessons
1

In this module

  • Compute with //, %, ** and /, using precedence and parentheses to control the order Python evaluates a longer expression.
  • Predict what // and % give with negative numbers, and recognize the ZeroDivisionError that dividing by zero raises.
  • Shorten repeated updates to a variable with augmented assignment.
  • Use abs, min, max, divmod and pow instead of writing that arithmetic by hand.

Before this module

Lessons

  1. 1Integer arithmetic and operators

Practice

Try this on the judge. The link opens the problem on WMOJ.

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

    Turn five judges' scores and a difficulty factor into one final score.