For paperwork and accounting purposes, let’s record the total value of your inventory. It’s nice to know what we’re worth!



Let’s determine how much money you would make if you sold all of your food.

  • Create a variable called total and set it to zero.
  • Loop through the prices dictionary.
  • For each key in prices, multiply the number in prices by the number in stock. Print that value into the console and then add it to total.
  • Finally, outside your loop, print total.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?