Signed up recently but had issues with the confirmation email?

Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.

Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.

Revision notesQuestionsFor schools
Revise Computing
Log inStart revising free
Revision notesQuestionsFor schoolsLog in
GCSE Computer Science/Supplementary programming practice/Iteration

Loop patterns

301.10 Iteration

Practise exam questions

Iteration — Note 3 of 4

Counters, totals, repeat-until.

What you need to know

Common loop patterns include counting occurrences, accumulating a running total, and repeating until a condition is met. These patterns appear in almost every program.

What to know

  • Counter: count = count + 1 inside a loop
  • Running total: total = total + value
  • Repeat-until: set value, while invalid, re-ask
  • Initialise counter/total BEFORE the loop starts

Code examples

Counter and running total
python
total = 0
count = 0
for i in range(5):
    num = int(input("Number: "))
    total += num
    count += 1
print("Sum: " + str(total) + ", Count: " + str(count))
← Previous noteWHILE loops301.10 IterationNext note →Loop bugs301.10 Iteration

Back to Iteration

Specification notes for programming are in Paper 2.

Iteration

Note 3 of 4

  1. 1FOR loops
  2. 2WHILE loops
  3. 3Loop patterns
  4. 4Loop bugs
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Worried about something?Question Bank UpdatesPrivacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).