Https://www.codecademy.com/courses/learn-python/lessons/a-day-at-the-supermarket/exercises/keeping-track-of-the-produce-?action=resume_content_item

Why does my code, which “Print[s] the answer in EXACTLY the following format”:

’apple price: 2 stock: 0’

does not pass the test?

Here’s my code:

prices = {
  "banana": 4,
  "apple": 2,
  "orange": 1.5,
  "pear": 3
}

stock = {
  "banana": 6,
  "apple": 0,
  "orange": 32,
  "pear": 15
}

for key in prices:
  print key, "price: %s" % prices[key], " stock: %s" % stock[key]

Here’s a screenshot for further reference.

https://www.codecademy.com/courses/learn-python/lessons/a-day-at-the-supermarket/exercises/keeping-track-of-the-produce-?action=resume_content_item

Thank you for your help!

The SCT is in need of adjustment for this lesson. For now, just use three print statements to output on three lines…

orange
price: ...
stock: ...
2 Likes