Python course · Chapter 3
Numbers and maths
Operators, // and %, order of operations, rounding.
Project: a pizza splitter.
- 3.1The operatorsAdd, take away, multiply, divide and raise to a power, and when the answer is a whole number or a decimal.Start →
- 3.2Whole-number divisionHow many whole times does it fit, and what's left over? // and % answer both questions.Open →
- 3.3Order of operationsPython does multiplication before addition, just like in maths, and brackets let you decide the order.Open →
- 3.4Rounding and tidyinground(), int() and abs(): turn long decimals into tidy answers.Open →
- 3.5Project: pizza splitterPut the chapter together: share pizzas fairly, count the left-over slices and work out the cost.Open →
- CheckCheckpointFive mixed questions on numbers and maths, with Chapters 1 and 2 mixed back in. Pass them all to finish the chapter.Open →