PEP 8 standard

User guide

This scheme mainly uses the PEP 8 programming standard. This is helpful for schools using the PyCharm IDE.

  • Subprograms start with a lowercase letter.
  • Identifiers are in snake case.
  • Subprograms have two blank lines between them.
  • There is a blank line at the end of the program.
  • In-line comments have two spaces before the comment.
  • Long statements such as enumerated data for arrays and lists are separated onto new lines.
  • Using Boolean operators instead of mathematical operators for Boolean conditions. Ie. not instead of !=.

Not all of the expectations of the standard are adhered to in order to make the learning journey easier for students. Most notably arguments and parameters have the same identifiers. This just helps students understand that they are essentially the same value, even though they are not the same variable.

Edexcel good programming guide and PLS

Most of the good programming guidance has been used as advised.

  • Layout of library, subprograms and main program sections including the use of comment hyphen separation.

# -------------------------

# Subprograms

# -------------------------

  • This does not include sections for constants or global variables so that earlier programs are easier to understand without the confusion of local and global variables. Students can be encouraged to add these sections to their programs.
  • Identifiers use snake case instead of camel case so that it conforms to PEP 8 standard.
  • Variables are not declared with a data type before they are initialised. Although this is good practice and prepares the ground work for transition to languages such as C#, it is unlikely students were taught to do this at Key Stage 3. We do this for languages where it is mandatory. The PLS supports implicit data typing with assigned initial values so our approach conforms to that instead.
  • Flow commands such as break, exit and continue statements are not used.
  • Try/except is not set out in the PLS although it is not discouraged.

Registered in England and Wales: 10442992

VAT Number: 290 9845 58

Telephone: 01452 947500

Email: admin@craigndave.co.uk

Craig'n'Dave logo

Craig 'n' Dave

Bett Awards 2024 Finalist