Chapter 1 · 5 levels
Python basics
Variables, numbers, strings and decisions, practised on real checkout maths from the Harbor & Pine store.
StartWelcome to Harbor & Pine. Before you touch a single spreadsheet-sized table, you need the small
building blocks every Python script is made of: variables that hold values, arithmetic on prices
and quantities, text that you clean and format, and if statements that make decisions.
None of this is abstract. Every level is a request from a colleague: a total for a customer on the phone, the number of boxes the warehouse needs, a shelf label for a product, the shipping fee for a cart. The chapter ends with a boss level where you build a small checkout calculator from start to finish.
You don’t need any prior programming experience. Each level runs real Python in your browser, and
your answer is checked by looking at the value you store in a variable called result.
Levels
- How many boxes does the warehouse need?
from Debra Marshall, Warehouse Manager
floor division, modulo, math ceil, int
- Format a shelf label
from Thomas Whitaker, Head of Merchandising
strings, strip, upper, f strings, number formatting
- Pick the right shipping fee
from Megan Collins, Head of Sales
booleans, comparison, if elif else, and or
- Boss: build the checkout calculator
from Kevin Nguyen, Head of Engineering
variables, arithmetic, strings, if elif else, f strings