Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Sales and Shipments | Section
Python Basics for Data Analysis
Sección 1. Capítulo 29
single

single

bookChallenge: Sales and Shipments

Desliza para mostrar el menú

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.

Tarea

Swipe to start coding

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>

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 29
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

some-alt