Group a calculation — quick review
Four supply kits sit on a table.
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.
Write
6 + 3to count the pieces for one kit.Put parentheses around that addition to get
(6 + 3).Put
* 4after the group to count four kits.
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.