Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
Start with a dictionary of product name -> quantity (integers), e.g. {"pencil": 20, "eraser": 15}.
Loop reading commands:
show - print all products and quantities.add PRODUCT QTY - split the line; increase that product’s count by QTY (assume product exists and QTY is a valid int).stop - exit the loop.You may assume commands are well-formed for add.
Skills: dict mutation, split(), string commands.