Section 5. Chapter 8
single
Challenge: Solo Coding Capstone
Swipe to show menu
Task
Swipe to start coding
Evaluate each item in the inventory dictionary based on its stock level. Loop through each item in inventory.
- If the stock is below
30, print that the item needs restocking, then print its regular price. - If the stock is above
100, print its discounted price. - If the stock is between
30and100, inclusive, print its regular price.
Required Output
Use these print statements exactly:
print(f"{item} need restocking.")
print(f"{item} should be sold at the discounted price of {discounted_price}.")
print(f"{item} should be sold at the regular price of {regular_price}.")
Follow the required format exactly.
Solution
Everything was clear?
Thanks for your feedback!
Section 5. Chapter 8
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat