class, __init__, self — the three keywords AI uses every time — step 9 of 9
Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
AI handed you the skeleton of a Cart class. The __init__ and add
methods are wired correctly. Your job: finish the total method so it
returns the sum of all prices currently in self.items.
Expected output:
17
⌘↵ runs the editor.read, then continue.
Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
AI handed you the skeleton of a Cart class. The __init__ and add
methods are wired correctly. Your job: finish the total method so it
returns the sum of all prices currently in self.items.
Expected output:
17
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.