セクション 5. 章 9
single
Challenge: Automating Stock Control
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
You are restocking a grocery store before opening.
For each item in inventory, keep adding the restock amount until the stock reaches the target stock level.
Rules:
-
Print
Restocking startedbefore you begin. -
Use a
forloop to go through each item ininventory.- For each item, print:
Restocking <item name>
- For each item, print:
-
Use a
whileloop to restock that item until:current stockis at least thetarget stock level- Each time the loop runs, increase stock by the
restock amount
-
Update the
current stockinside the dictionary after restocking. -
Print
Restocking completedafter all items are processed.
Do not print any extra details about the stock numbers. Only print the required lines.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 5. 章 9
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください