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 theZeroDivisionErrorthat dividing by zero raises. - Shorten repeated updates to a variable with augmented assignment.
- Use
abs,min,max,divmodandpowinstead of writing that arithmetic by hand.
Before this module
Lessons
Practice
Try this on the judge. The link opens the problem on WMOJ.
- 2026 J2Olympic Scores (opens on WMOJ in a new tab) WMOJ
Turn five judges' scores and a difficulty factor into one final score.