Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Sales and Shipments | Section
Python Basics for Data Analysis
Sezione 1. Capitolo 29
single

single

bookChallenge: Sales and Shipments

Scorri per mostrare il menu

In this challenge, you'll manage the daily stock levels of essential grocery store products over a week. By utilizing the range() function in conjunction with the len() function, you'll simulate sales impacts on inventory.

Compito

Scorri per iniziare a programmare

Update product stock levels based on sales and shipments using loops.

  • Use a for loop with index iteration to go through the products list.
    • For each product, subtract the number of units sold (units_sold) from the products stock.
  • Use a second for loop (also with index iteration) to go through products again.
    • Add the corresponding value from shipment_received to update the stock.

At the end, print: Final stock levels for all products: <products>

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 29
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt