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

Comments

301.7 Maintainable Code

Practise exam questions

Maintainable Code — Note 3 of 4

Explain code blocks.

What you need to know

Comments are notes in the code that Python ignores. Use # for single-line comments. Good comments explain why code does something, not what it does (the code itself shows that).

What to know

  • # starts a single-line comment
  • Comments are ignored by Python
  • Explain WHY, not WHAT: # Apply 20% discount
  • Don't over-comment obvious code
  • Use comments to mark sections of a program

Code examples

Using comments
python
# Calculate final price with VAT
price = 50
vat = price * 0.2  # 20% VAT rate
total = price + vat
print(total)
← Previous noteIndentation301.7 Maintainable CodeNext note →Tidy code comparison301.7 Maintainable Code

Back to Maintainable Code

Specification notes for programming are in Paper 2.

Maintainable Code

Note 3 of 4

  1. 1Meaningful names
  2. 2Indentation
  3. 3Comments
  4. 4Tidy code comparison
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Privacy noticeTermsContact

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