promptdojo_

elif chains and the match statement Cursor reaches for — step 7 of 9

Cursor wrote a match statement that handles three commands but forgot the catch-all. When command = "shutdown" (which isn't in any case), the variable result never gets set, and line 11 crashes with a NameError.

Add a case _: block at the end so unmatched commands produce result = "unknown". The script should print unknown.

The break is on line 9 — but read the whole snippet first.

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