Program Structure
For readability, programs should follow a standard layout:
imports constants record/object definitions subprograms main program
Naming Conventions
Proper use of capitalisation and plurals makes lines like this readable:
students = [Student() for student in range(STUDENTS)]
Capital and small letters
Constants should be in full capitals:
NUMBER_OF_STUDENTS = 20
All variables and subprogram names should be in either camelCase or snake_case.
Be consistent – use one or the other, but not both:
studentName = "fred" student_name = "fred"
Record definitions should be in PascalCase:
@dataclass class SchoolPupil:
Singular and Plural Names
Variables that store a single value should use singular names:
name = "fred" age = 23
Variables that store a several values (arrays and lists) should use plural names:
names = ["fred", "sue", "alice", "mark"] ages = [23, 45, 12, 19]