elif chains and the match statement Cursor reaches for — step 6 of 9
Claude generated a grade-letter chain. The output for score = 95 is B
instead of A. The broader condition >= 80 is being checked before the
narrower >= 90, so a 95 always falls into the B bucket.
Reorder the branches so a 95 prints A, and the chain still works for
other scores.
The break is on lines 3, 5 — but read the whole snippet first.
⌘↵ runs the editor.read, then continue.
Claude generated a grade-letter chain. The output for score = 95 is B
instead of A. The broader condition >= 80 is being checked before the
narrower >= 90, so a 95 always falls into the B bucket.
Reorder the branches so a 95 prints A, and the chain still works for
other scores.
The break is on lines 3, 5 — but read the whole snippet first.
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.