This lesson includes a working Python compiler. Your lesson stays here while you practise.
Your learning progress
Checking your account...
In this lesson
Understand the idea
Understand the idea
See how it works
PYTHON exampleRead the code, then try a change.
ReferenceCompare this with the explanation.
See how it works
PYTHON exampleRead the code, then try a change.
ReferenceCompare this with the explanation.
See how it works
PYTHON exampleRead the code, then try a change.
ReferenceCompare this with the explanation.
Understand the idea
Check your understanding
Spot the mistake
Your turn
Your turn
Predict before you run
Follow the program
1
2
3
Step 1 of 3
This is an authored walkthrough, not a live debugger. Run the code in Practice to verify the result.
Change it and explain it
Loading an example does not run it. Your existing edits are protected by a replacement confirmation.
AI suggested activity
Build the result yourself. Complete every check in a part to unlock the next part of this same lesson. You can retry freely.
Your turn
Lessons, practice, tests and Codi voice are open to everyone. Cloud voice requires consent and shares a limited free allowance. Sign-in is required for AI assignment feedback and is optional for saving progress. Guest work clears on reload; signed-in students can restore their last saved checkpoint.