Quarry School

Choose an arithmetic operator — quick review

In plain words

A volunteer is measuring ribbon for four display frames.

Rule

Use + to add an amount, - to take an amount away, * to find the total of equal groups and / to share an amount equally. In 4 * 6, the operands are 4 and 6, the numbers that * works on.

Start with whole numbers such as 4 and 20. To subtract, put the starting amount first and the amount you remove second. To divide, put the amount to share first and the number of shares second. The number to the right of / is the divisor. In this example, it counts the frames, so it must be at least one.

Python calls numbers such as 2.5 and 5.0 floats. In these examples, / gives a float even when the share is a whole number of meters.

Step

  1. Say what is happening. Are you adding a piece, taking one away, finding the total of equal groups or sharing equally?

  2. Choose the operator for that action. Put it between the two numbers in the order described above.

  3. To show the result, type print and put the calculation inside the parentheses ( and ). Type the source lines below in a file in your editor. Save it as ribbon.py and run it with Python 3.13. You can also follow along on paper with the printed trace, which shows the results in order.

Trap

If you reach for the letter x when you mean “times,” type the asterisk *. That is Python’s multiplication sign.

Both numbers in 20 / 4 are whole numbers. The length per frame is exactly 5 m, and Python displays that result as 5.0. The .0 is part of how Python writes this float.