Teacher-curated, self-paced courses. Looking for a guided sequence through a full topic? See Learning Paths.
Until now, a program did every line, one after the other. In this course it learns to choose. You compare values, run some lines only when a condition is True, choose between two and then between many possibilities, and learn how to test every branch so that the program is right at the edges, where mistakes hide. You finish with a ticket office program. The practice runs your decisions on many test values and tells you which ones fail.
One simple condition is often not enough. A person can enter a club if they are old enough and have a ticket. A shop gives a discount to students or to senior citizens. In this course you combine conditions with and, or and not, check a range, ask whether a value is inside a group with in, and put one decision inside another. You learn to prove a combined condition with a truth table, and to simplify a condition with the rule of not. A club entry program at the end uses everything. The practice tests your conditions on many cases and tells you which ones fail.