Keep tracking on the procedure


#1

Hi,

This is the first time I encounter problem when Learning Python and I am really curious how to solve it as I do not want to clik the “solution” button. I have read all post related to “keep tracking on the procedure” and I have implemented some response, but it is still error.

Thank you in advance for any advices.


#2

what is the chapter this is asked in (like the number i mean, a link would be awesome as well) ?

what is the problem you encounter ? there doesn’t seem to be anything wrong with your code.


#3


#4

your variable is called price while it specifically asks for the variable name prices. Codecadamy is very specific when it comes to naming things when they ask for it.


#5

Hi @punkt.zh ,

@biirra is correct that Codecademy expects variables to be named according to the specifications provided in the lessons. Be careful to adhere closely to the instructions.

In A Day at the Supermarket: Your Own Store!, you are asked to create a dictionary named prices with four specific items in it.

In the next exercise, A Day at the Supermarket: Investing in Stock, you are asked to create another dictionary named stock, also with four specific items in it.

In the current exercise, A Day at the Supermarket: Keeping Track of the Produce, you still need those same dictionaries, and must loop through them to produce the correct output.


#6

Hi biirra,

Please help with my code given below, even I used proper naming conventions as asked but its giving “Check what your code prints for orange. It doesn’t look quite right!”

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

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

for fruits in prices:
print
print fruits
print "prices: %s " % prices[fruits]
print "stock: %s " % stock[fruits]


#7

Sorry for the late reaction, i have been sick.

could you try this?

  • In the for loop you start with an empty print. Try deleting this print. Codecadamy might not expect an empty print.
  • print "price: %s" % prices[fruits] in this line. i think you have a space after %s try removing this space. Do this for print "stock: %s" % stock[fruits] as well if this is the case.

Sometimes or maybe always Codecadamy also looks at the output (this includes empty spaces). So gotta be careful to not spice it up to much XD

My output looked like this for it to be accepted:

orange
prices: 1.5
stock: 32
pear
prices: 3
stock: 15
banana
prices: 4
stock: 6
apple
prices: 2
stock: 0