What is creating problem


#1


#2

You just need to change your prices[key] print statement to price and not prices and also you had two ss's instead of one in your placeholder,

print "price: %ss" % prices[key]

to,

print "price: %s" % prices[key]

That should clear the error. :grin:


#3

not solved even for me,it always pops-out the same error


#4

Please post your code :slight_smile:


#5

Neither me, I think they want the numbers as integer and not string but i cant solve it. This is my code:

prices={"banana":4, "apple":2, "orange":1.5, "pear":3}
stock={"banana":6, "apple":0, "orange":
32, "pear":15}

for fruit in prices:
print fruit
print "Price: %s" % prices[fruit]
print "Stock: %s" % stock[fruit]


#6

Is your code indented like this?

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

#7

Yes, it is. I couldnt put the spaces in the page but its exactly like that.


#8

Hmm..try reverting to all lowercase to test if the SCT does not want uppercase letters like this,


#9

This worked for me. Thank you!


#10

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.