Lesson 2 · Computational Thinking
Mapping choices and outcomes.
A single IF handles a single question. But real decisions stack up.
Should I cycle to school? Well — is it raining? If no, is the cycle working? If yes, is there time?
Each answer leads to the next question, and eventually to an outcome. Draw that out and you get a decision tree: questions at the branches, outcomes at the ends.
A decision tree has two kinds of points:
You always start at the top and follow one path down. You never visit two branches at once, and you always finish at exactly one leaf. That's what makes a tree reliable: every possible situation leads somewhere definite.
5 more parts in this lesson
Walkthroughs, code labs, mini-games and the checkpoint quiz unlock when you buy the course.