Learn
For paperwork and accounting purposes, let’s record the total value of your inventory. It’s nice to know what we’re worth!
Instructions
1.
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 inprices
by the number instock
. Print that value into the console and then add it tototal
. - Finally, outside your loop,
print total
.
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.