Who this book is for
Learners ready to combine familiar Python tools into larger problems involving lists, grids and image data.
Before you begin
Be comfortable with variables, decisions, loops, lists and functions. Python Foundation is the earlier book in this series.
Practical Python problem solving for GCSE learners, with applications that extend beyond individual exam questions. Check your board's specification for its assessed requirements.
Inside the book
Learning themes across 10 chapters
- Reliable loops and list processing
- Searching lists
- Nested loops
- Rows, columns and two-dimensional lists
- Representing and processing image data
- Combining and testing a complete project
Work through explanations and examples, try the independent practice, then use the explained answers to review your reasoning.
Try the approach
Read a grid one row at a time
A list can contain other lists. Each inner list below represents one row.
grid = [[2, 3], [4, 1]]
for row in grid:
total = 0
for value in row:
total = total + value
print(total)What it prints
5
5The outer loop chooses a row. The inner loop adds that row's values. Resetting total inside the outer loop gives a separate total for each row.
This short public example introduces an idea explored in the book.
