I’ve already submitted 3 times this assignment and I always obtain 0/100. I’ve already checked for several times, as well as, restarting the kernel and clear the output and I have the “All tests passed! Correct import statement used!“ statement in every exercise. Am I wrong in something? Or is a platform issue? Here I put some screenshots.
(Solution code removed, as posting it publicly is against the honour code of this community, regardless if it is correct or not. You can share the errors you get)
Did you perhaps add any new cells to the notebook?
Or delete any of the cells?
Or delete any of the provided code outside of the areas marked for you to add your code?
Or download the notebook to work on some other platform, and then upload it back to Coursera for grading?
Any of those things will make your notebook fail the grader.
The function get_top_candies() is a helper function under the helper function file which is imported just before the code cell for EX4. You should find the full instructions in that section. If your lab file is corrupted, you can get a fresh copy:
rename your current lab file to a different name
Click on the 3 dots on the top right of your notebook, a pop up will open with option to restore the original copy.
I just deleted in some parts the comment #Add code here and replaced it with my code. I also have the “All tests passed statement” so I guess everything is correct.
The oly mistake I think I made was to rename the notebook but I’ve already rename it back as “C1M4_Assignment”. Is anything else I should check?
On Coursera, you will have to delete your notebook (using the “File->Open” menu), and then use the Lab Help tool (the question-mark inside a circle), and its “Get latest version” command. Then exit and re-enter the course, and access the lab. You should then have a fresh copy so you can start over.
Thanks! I could restart it again but now I have these mistake on the exercise 4. I’m just errasing the comments where I should insert the code. Here a screenshot:
(Solution code removed, as posting it publicly is against the honour code of this community, regardless if it is correct or not. You can share the errors you get)
Sorry, I’m not a mentor for that course, so I don’t have access to the original programming assignment files. So I can’t compare your code to the correct solution.
For this exercise, the import format specified importing the whole module, named ex4_helper_functions.
In order to access anything (such as function, variables etc) inside that module, we need to prefix it with the module name. So in this case, it would look like this:
ex4_helper_functions.get_top_candies(candy_data, avg_popularity)
Are you a mentor? I have exactly same issue, 0% and all is correct, and it’s been 7 weeks and 9 tickets in the Coursera platform. Finally they referred me to this forum. Nothing was deleted or removed from the notebook. I restarted kernel, and saved notebook before submission. Any advice how to resolve this? No code errors. I’m really looking for help here.
If you have “exactly the same issue”, then this should be the solution for you as well.
If that is not the case for you, please show us the error you are getting. Also, are you taking this course on Coursera or DeepLearning.AI’s own Learning Platform?
I’m taking class through Coursera, by “Exactly same issue” I meant same error. Grade 0% received. I don’t have however coding errors, get_top_candies() returns what’s supposed to and it matches to the expected output and shows all green. The only error is Grade 0%. I can’t attach an entire screen not to share the code but part of the error is attached.
I did ctrl F to find in my notebook if there is somewhere else get_top_candies(candy_data, avg_popularity) . It did showed that it found 2, but highlighted ONLY 1. Looks like another one is hidden somewhere, hence I can’t fix it and which is why it still throws me an error. Any ideas where it could be hiding?
The get_top_candies() function is defined in this file named ex4_helper_functions.py However, the error from your screenshot is for ex1. So your code must have get_top_candies in ex1. Please check.
every exercise is throwing same error, which is odd and doesn’t make sense because it’s actually being called in Exercise 4 and nowhere else. I consolidated errors from each exercise, image is attached.
Oh, and this time around when I search for “get_top_candies(candy_data, avg_popularity)” I got one item found if I search for it, which DOES make sense. Any other ideas?
When your code has an error that makes the grader crash, it reports the same error message for every function. So the error messages don’t tell you which exercise is causing the issue.
But it does say what is causing the error (in your case, there’s a problem with “get-top_candies”).