My code prints the item, price, and stock - why isn’t it accepted?
Answer
Codecademy checks for exactly the answer that it’s looking for in the instructions. This includes spelling, capitalization, spacing, and punctuation. If any of those are different, it’ll count it wrong.
The most common issue is printing prices: rather than price:, or capitalizing either word printed out.
Also, be sure to convert the value stored in the dictionaries to a string using the str() function so you can print it out!
Following your explanation, it would then seem that there’s a bug if Codecademy can’t recognize the code in the below image as being a correct solution and also fails to display any error message?
The only difference is in the variable name, but the instructions didn’t specify a variable name to use for the for loop.
Edit: I even tried to copy the code from the Solution given and pasting it after resetting the exercise, and Codecademy still doesn’t recognize it. It seems that the only way to move on from this exercise is to click on “Solution” for the “Next” button to light up.
I can’t understand why i dont get the ok with my code on the same lesson. And i don’t understand the answers on this topic about why my code isn’t be accepted by the editor.
On lesson 7 “Investing in stock”, this was my code answer :
Same issue here. Followed every hint, converted numbers into string for print to display it without any issues, but CC won’t let it go through, nor does it display any error message.
I guess for non Pro Codecademy users, we’re stuck. Regardless of pressing the Solution button, as all it does is show a popup that gets me back to where I was. I wish someone would come up with a solution :-/
Maybe try reporting it as a bug? (in the left panel, all the way at the bottom, below the Instructions)
For me and seemingly some other users, pressing the “Solution” button actually enables the “Next” button, and for one I’m not a Pro user, so there must be something wrong with your CC.