Am I Misreading 9/13's Instructions


#1

Hi all,

I submitted this as a “bug” but I thought I’d ask here as well. Feedback? Thoughts?

I think the instructions either need some clarification or there may be a bug in allowing the lesson to pass prematurely. My understanding of the instructions was that the total for each individual fruit would first get printed (e.g., price * stock for banana would be printed, then for apple, etc.). Then at the end, a separate total is calculated that includes all of the fruit, so that five prices are printed. In my attempt, I was able to pass the lesson by calculating the total price of bananas, then calculating the total price for apples, but not printing that cost out and instead automatically adding that to the cost of bananas and printing that out, and so on (e.g., if the cost of oranges is 48 and the cost of pears is 45 I get four print outs; first 48 then [48+45=] 93 and so on).


#2

Without a link to the exercise we can only speculate, but say we have three fruit in our stock and prices dictionaries,

stock = {
    'apple': 20,
    'orange': 50,
    'pear': 15
}
prices = {
    'apple': 3.00,
    'orange': 1.50,
    'pear': 2.50
}

Were we to evaluate the inventory worth,

>>> value = 0
>>> for item in stock:
    value += stock[item] * prices[item]

    
>>> print (value)
172.5
>>> 

#3

Just worked on this level, printed the correct solution (117) but it did not count as complete since the syntax was not exactly the way they wanted it.
Definitely seems like a bug to me.


#4

The output should resemble the example given in the lesson to the left of the editor. No upper case, and be sure there is one space after the colon.