Keeping track of produce


#1

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
print " prices : %s" % prices[key]
print " stock : %s" % stock[key]

error message
Oops, try again. Check what your code prints for orange. It doesn't look quite right!

while everything lookms in order

Replace this line with your code.

`


#2

Hi @saadiasaadat,

This exercise is unusually strict in that they really want you to follow this syntax

apple
price: 2
stock: 0

exactly, down to each and every spacing.

Let us take a look at what you wrote:

Compare what you are printing with the instructions given. There are multiple changes to be made (hint: 3 changes), you can try to spot all 3 :slight_smile:

Let me know if you need me to give an example...


#3

got it price and spacing with colons:) thanks


#4

you're welcome :slight_smile:


#5

A computer won't correct you if you're almost right. It'll do as you say. Nearly right might as well be completely wrong a lot of times.

"Almost successful plane landing"