functions#
Series: lecture-python-programming
File:
lectures/functions.mdAudit date: 2026-05-28
Categories audited: writing, math, code, figures, references, links, admonitions (JAX out of scope)
Overall score: 8.1 / 10
Priority: LOW
Score breakdown#
Category |
Score |
One-line note |
|---|---|---|
Writing |
6.5/10 |
Section headings systematically use Title Case. |
Math |
N/A |
Only trivial |
Code |
8/10 |
PEP8 compliant; only Anaconda packages (numpy); no benchmarking patterns; no Greek identifiers needed. |
JAX |
out of scope |
— |
Figures |
N/A |
No figures. |
References |
N/A |
No citations. |
Links |
9/10 |
Uses |
Admonitions |
9/10 |
Five |
Issues#
Critical#
None found.
High severity#
[qe-writing-006] — Almost every H2/H3 section heading uses Title Case rather than sentence case. Examples: line 47
## Function Basics, line 55### Built-In Functions, line 80### Third Party Functions, line 94## Defining Functions, line 100### Basic Syntax, line 168### Keyword Arguments, line 213### The Flexibility of Python Functions, line 227### One-Line Functions: \lambda`, line 266### Why Write Functions?, line 277## Applications, line 279### Random Draws, line 324### Adding Conditions, line 408## Recursive Function Calls (Advanced), line 462## Exercises, line 619## Advanced Exercises`. Count: 15+ occurrences.
Medium severity#
None found.
Low severity#
[qe-writing-001] — A few multi-sentence paragraphs (e.g., around line 297, a bulleted explanation embedded in a paragraph).
[qe-code-001] — Some solution snippets have inconsistent operator spacing (e.g., line 605
count + ( 1 if ... else 0 )with internal parenthesis padding). Minor PEP8 nit.
Strengths#
Lecture title “Functions” follows qe-writing-006.
Clean prose, code-block formatting, inline backticks.
Exercise/solution structure is exemplary — gated syntax (qe-admon-001), dropdown class (qe-admon-002),
:label:linkage (qe-admon-005).All five exercises use gated
exercise-start/exercise-endsyntax (no bare{exercise}directives that would block embedded code cells).No benchmarking magic, no
time.time(), notic/toc.
Recommended actions#
Convert all H2/H3 headings to sentence case (“Function basics”, “Built-in functions”, “Third party functions”, “Defining functions”, “Basic syntax”, “Keyword arguments”, “The flexibility of Python functions”, “One-line functions:
lambda”, “Why write functions?”, “Random draws”, “Adding conditions”, “Recursive function calls (advanced)”, “Advanced exercises”).Tighten spacing in code (e.g., line 605) for PEP8 consistency.