Keep Track of Produce (Orange problem)


#1

Here's my code. I see nothing wrong at all! Is there a bug with the code checker?

prices = {"banana": 4, "apple": 2, "orange": 1.5, "pear": 3}
stock = {"banana": 6, "apple": 0, "orange": 32, "pear": 15}
for item in prices:
print item
print "price: ", prices[item]
print "stock: ", stock[item]


#2

Missing modulo formatters.

print "something %s" % variable

#3

I tried that before. Didn't work. And based on the instructions, there's no need for that.


#4

Never mind. I see it now.
But my syntax of print "something: ", something[item] should be equally valid, isn't it?


#5

Yes, just that the SCT didn't accept it. Raw output can be a comma separated list. String formatting is a great tool once we get the hang of it.


#6

Thanks for that. What's SCT?


#7

SCT => Submission Correctness Test

The lesson checking program behind each lesson.