label_scores(scores, cutoff) returning a list where each score is replaced by the string "pass" if it is at least cutoff, else "fail". Note the difference from filtering: here the if/else sits in the expression position, so every score produces an output.label_scores([35, 80, 50], 40)
['fail', 'pass', 'pass']
35 is below 40; the others meet the cutoff.
The pattern is [A if cond else B for x in xs].
No trailing if-filter here.