Unit 3 Task 15: Inventory commands

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Unit 3 Task 15 - Inventory commands

← Unit 3 tasks - Solution


Start with a dictionary of product name -> quantity (integers), e.g. {"pencil": 20, "eraser": 15}.

Loop reading commands:

You may assume commands are well-formed for add.

Skills: dict mutation, split(), string commands.