promptdojo_

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.

full-screen editor opens — close anytime to keep reading.