Skip to main content

Practice · 1 of 1

Subcommand Router

CHALLENGE
Difficulty: intermediate+25 XP

Implement main(argv) (argv is a list like ['add', 'milk']) returning the exit code int: 'add' with text → prints 'added: <text>' and returns 0; 'list' → prints '2 tasks' and returns 0; unknown command or 'add' without text → prints the error to stderr and returns 2. (The grader captures stdout/stderr.)

Back to lesson: Practice: CLI Entry Drills