Seeking help for the Candy Analysis Programming Assignment of the module 4

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.

Hi @alanron03

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:

  1. rename your current lab file to a different name
  2. 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?

Also, every question has this issue and I’ve already saved before submitting:

Hi,

I’m doing the course with Coursera and that doesn’t appear, I don’t know how to restore the original copy. Coursera doesn’t have the 3 dots.

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.

Hi @alanron03 ,

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)

Hi @alanron03,

Did you get a chance to fix this?

As you can see from the error, the code cannot identify get_top_candies function.

The “Hint” is telling you what needs to be done.

If you need a bigger hint, just look at how the last line in the cell is accessing the display_pretty_table

Best,
Mubsi

1 Like