Unit 2 Tasks

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Unit 2 tasks

These challenges use ideas from Unit 1 (types, variables, operators) and Unit 2 (conditionals, while / for, break, and random). Try each task on your own first, then peek at the linked solution if you are stuck.

Lessons: 1.1 Types · 1.2 Variables · 1.3 Operators · 2.1 Conditionals · 2.2 Loops

Navigation

Tutorials: Tutorial 2.1 · Tutorial 2.2


Warm-up - one choice or short loops

Loops with decisions - money, games, and data

Applied scenarios - shops, travel, and patterns

Stretch - nested loops, math, and trickier control flow


Solutions are on separate pages: e.g. Task 1 solution.