Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Solo Coding Capstone | Loops
Introduction to Python
Section 5. Chapter 8
single

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 30 and 100, 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

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 5. Chapter 8
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt