Quarry School

Group a calculation

Subject: Computing
Level 1 · FoundationsAbout 3 min read
How this was estimated

Programmatic estimate. Rung levels, worked steps, prerequisites, terms and sentence length contribute to this level. It describes the lesson, not your ability.

Reading counts the whole lesson, including folded explanations, at 180 words a minute. Practice allows two minutes per item. These are planning assumptions; take the time you need.

AI estimate unavailable.

Path to here

Open the unit’s lesson list to follow the lesson order.

    Quick review (2 minutes)

    In plain words

    Four supply kits sit on a table.

    Rule

    When parentheses group an addition, do the addition inside them before multiplying by the number outside. In a calculation with addition and multiplication and no grouping parentheses, Python does the multiplication first.

    Step

    1. Write 6 + 3 to count the pieces for one kit.

    2. Put parentheses around that addition to get (6 + 3).

    3. Put * 4 after the group to count four kits.

    Trap

    Reading 6 + 3 * 4 strictly from left to right would give 36. Python does 3 * 4 first, which counts 12 rings, then adds six clips once, for 18 pieces. To count six clips in every kit, group the two counts as (6 + 3) * 4.

    1 In plain words

    Four supply kits sit on a table. Each kit needs six clips and three rings. How many pieces do you need for all four kits?

    When you calculate with numbers in Python, + means add and * means multiply. The curved marks ( and ) are called parentheses. Read (6 + 3) * 4 as “six clips plus three rings for one kit, four times.” Remember to put parentheses around the counts that go together.

    2 Picture it

    Kits36 total

    Four kit trays each contain six filled marks for clips and three open marks for rings. That is nine marks per kit and 36 marks in all.

    The parentheses group the contents of one kit.

    3 Why

    You need the same set of pieces for each kit. Add six clips and three rings to get nine pieces for one kit. Multiplying that nine by four counts one set of pieces for each of the four kits.

    4 The rule

    When parentheses group an addition, do the addition inside them before multiplying by the number outside.

    In a calculation with addition and multiplication and no grouping parentheses, Python does the multiplication first.

    5 How

    1. Write 6 + 3 to count the pieces for one kit.
    2. Put parentheses around that addition to get (6 + 3).
    3. Put * 4 after the group to count four kits.

    6 Worked example

    Count the pieces in four kits

    Python code
    print((6 + 3) * 4)
    print(6 + 3 * 4)
    

    Standard input

    Empty

    Standard output

    36
    18
    

    Type both lines into an editor and run the file with Python 3.13. The first line counts all parts of all four kits. The second counts the clips once and the rings four times.

    Trace

    Compare how the two expressions group the supplies
    ExpressionFirst valueOutputExplanation
    (6 + 3) * 46 + 3 = 936Make a kit, then count four kits. Separately, 24 clips plus 12 rings also give 36.
    6 + 3 * 43 * 4 = 1218Without the parentheses, multiply the rings first and count the clips once.

    7 The trap

    Reading 6 + 3 * 4 strictly from left to right would give 36. Python does 3 * 4 first, which counts 12 rings, then adds six clips once, for 18 pieces. To count six clips in every kit, group the two counts as (6 + 3) * 4.

    Quick checks

    Quick check 1 of 2

    In 6 + 3 * 4, how many clips and how many rings does Python count?

    Show the steps and the answer
    Answer

    6 clips and 12 rings, for 18 pieces.

    Why: Python multiplies 3 * 4 first, then adds the six clips once.

    Source: Python Software Foundation, An Informal Introduction to Python, 3.1.1. Numbers

    Quick check 2 of 2

    Three party bags each get seven cards and two stickers. Write a calculation with 3 first and parentheses around the two counts for one bag. How many pieces go in all three bags?

    Show the steps and the answer
    Answer

    3 * (7 + 2) gives 27 pieces.

    Why: Each bag gets nine pieces. Counting separately also gives 21 cards and 6 stickers, which add up to 27.

    Source: Python Software Foundation, An Informal Introduction to Python, 3.1.1. Numbers

    Sources

    1. An Informal Introduction to Python, 3.1.1. Numbers. Python Software Foundation. Python Software Foundation License Version 2. Read 26 Nov 2026.