Ive tried everything


#1

Ive tried changing from prices to price and indenting correctly but orange is still a problem somebody plz help - 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
print "price:%s" %prices[key]
print "stock:%s" %stock[key]


#2

Do you see a difference between:

apple
price: 2
stock: 0

and:

apple
price:2
stock:0

No? You have to add spaces :smile:

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

#3

What kind of error message are you getting? What is the problem you are having with oranges?

Could you paste your code again using this little trick so we can see your indentation?

Trick: Whenever you would like to paste code, since this forum supports Markdown you can use three backticks before and after your code block like so:

```
def my_func(x):
my_var = 0
if x > my_var:
sum = my_var + x
else:
print "Odelay!"
return sum
```

and it will retain proper indentation and even have nifty syntax highlighting:

def my_func(x):
    my_var = 0
    if x > my_var:
      sum = my_var + x
    else:
      print "Odelay!"
    return sum

#4

thank u it was the spaces , hyu!


#5

You're very welcome :smile:


#6

thank you for the backtix


#7

Thank you .................................................