A Day at the Supermarket
Why does the code not print the total? It seems to work when I set 'total' = 0 before the loop starts, but why doesn't it work when done inside the loop?
Replace this line with your code. for fruit in prices: total = 0 net = prices[fruit] * stock[fruit] print net total = total + net print total