Conditionals and the truthiness traps — step 8 of 8
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
One last thing. AI wrote a discount-rule script. The starter has the right
branches but the conditions are missing. Finish lines 4 and 6 so the script
prints vip discount.
Catch: points = 0 is a valid score (user has a record, just zero). The
truthy check if points: falls through to the wrong branch. Use
is not None so a real zero still counts.
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
One last thing. AI wrote a discount-rule script. The starter has the right
branches but the conditions are missing. Finish lines 4 and 6 so the script
prints vip discount.
Catch: points = 0 is a valid score (user has a record, just zero). The
truthy check if points: falls through to the wrong branch. Use
is not None so a real zero still counts.
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.