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

single

bookChallenge: Sales and Shipments

Glissez pour afficher le 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.

Tâche

Glissez pour commencer à coder

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>

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 29
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt