Start from zero: functions, conditions, loops and lists. Every later topic builds on these.
Key ideas
- A function takes input and hands back its answer with
return;printonly writes to the screen. ifpicks a path by a question;==asks whether two things are equal,%gives the remainder.forrepeats the same work:range(1, n + 1)counts from 1 to n,for v in valueswalks a list.- Start a variable before the loop (a counter, a total, a best), update it inside, return it at the end.
Pattern
count = 0
for v in values:
if v > 0:
count += 1
return countLessons
Each lesson explains one idea from zero and ends with a few tasks. Lessons open in order; the explanation can be read at any time.
Boss
08
Fizz Counter
Function
The boss opens when every lesson of the topic is finished. Solve it too and the topic is complete, and the topics after it open.