If you don't want spoilers for the code, I suggest you stop reading right here. But you may go on....
This code works:
for key in prices: print key print 'price: %s' % prices[key] print 'stock: %s' % stock[key]
This one does too:
for key in prices: print key print 'price: ' + str(prices[key]) print 'stock: ' + str(stock[key])
But not these two???
for key in prices: print key print 'price: ', prices[key] print 'stock: ', stock[key]
for key in prices: print '%s\nprice: %s\nstock: %s' % (key,prices[key],stock[key])
I'm aware that there are a lot of ways to do this part,
but why doesn't it accept the last two codes mentioned,
when in fact they all produce exactly the same result?
Is the section designed so that it prefers those first ones over these two?
Is this some way of encouraging students to adapt to some style/convention/rule?
If this is an issue, should it be fixed?
If not, then what is it?
All corrections and constructive criticisms are welcome. Thank you.