Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Arithmetic Operators

Operator precedence

All topicsPractise exam questions
Knowledge organiser

Arithmetic Operators

301.2d

Apply BIDMAS to expressions.

What you need to know

Python follows BIDMAS (Brackets, Indices, Division/Multiplication, Addition/Subtraction). Operations like **, *, /, +, - are evaluated in that order, just like in maths.

Key points

  • Brackets () are evaluated first
  • Then ** (indices/powers)
  • Then * / // % (left to right)
  • Then + - (left to right)
  • Use brackets to make order explicit and clear

Code examples

Precedence example
python
print(2 + 3 * 4)     # 14, not 20
print((2 + 3) * 4)   # 20
print(10 - 2 ** 3)   # 2 (10 - 8)