My salvation


#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]

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

output_to_console
orange
Prices : 1.5
Stock : 32
pear
Prices : 3
Stock : 15
banana
Prices : 4
Stock : 6
apple
Prices : 2
Stock : 0
None


Replace this line with your code.


#2

Check your capitalization in what you're printing. Codecademy interpreter can be picky.


#3

that didnt help everythign is now lowercase adn still same error


#4

You have an extra space in each line as well.

Between prices and : as well as stock and :


#5

whast the issue here i thought it would look neater lol ill be more mindful in future


#6

although again thats not helped
same error is being brought forward

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


#7

Remove the s from prices as well. Try to print out exactly what the instructions say.


#8

but the origianl name was prices why does that change now?
also i get a traceback error price not defined

idle is sayign

SyntaxError: multiple statements found while compiling a single statement

is this any help in guiding me to the solution


#9

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