Chapter 1 · 5 levels

Python basics

Variables, numbers, strings and decisions, practised on real checkout maths from the Harbor & Pine store.

Start

Welcome 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

  1. Compute an order total

    from Megan Collins, Head of Sales

    variables, arithmetic, round

    Code Difficulty 1 of 5 Not started

  2. How many boxes does the warehouse need?

    from Debra Marshall, Warehouse Manager

    floor division, modulo, math ceil, int

    Code Difficulty 1 of 5 Not started

  3. Format a shelf label

    from Thomas Whitaker, Head of Merchandising

    strings, strip, upper, f strings, number formatting

    Code Difficulty 1 of 5 Not started

  4. Pick the right shipping fee

    from Megan Collins, Head of Sales

    booleans, comparison, if elif else, and or

    Code Difficulty 2 of 5 Not started

  5. Boss: build the checkout calculator

    from Kevin Nguyen, Head of Engineering

    variables, arithmetic, strings, if elif else, f strings

    Boss · 3 steps Difficulty 3 of 5 Not started