Week 4 - Programming Assignment 1 - Grader Gives 0 Points

Ok, I think we need to look at your notebook in order to figure out why initialize_parameters is not defined. We can’t do that on a public thread, but please check your DMs for a message from me about how to proceed.

My guess is that something is damaged in the infrastructure of the notebook.

To close the loop on the public thread, the problem was a very creative one that I’ve never seen before:

The order of the cells in the notebook was changed so that the test cell for initialize_parameters comes before the function cell that defines initialize_parameters. So the only way to get it to work is to run the cells out of order.

Why did you do that? It took a fair amount of effort, meaning that it’s hard to see how that could have happened by accident. It wasn’t just an inadvertent keystroke somewhere.

1 Like

Perhaps it was an inadvertent drag-and-drop issue.

Yes, I guess that must be it, but the larger question is why one would be dragging cells around in the first place. It is not recommended. Or “contraindicated” as they say in the medical world. :nerd_face:

Actually it turns out I was wrong: there is an easy “one click” way to change the order of cells in a notebook. On the Edit menu there are items Move Cell Up and Move Cell Down as highlighted here:

If you highlight a cell (either Code or Markdown) and click one of those menu items, it will change the order of the cells.

So it actually is a mistake that you can easily make unintentionally. Please “Use with Caution” as changing the order of code cells will almost certainly cause problems unless the cells are completely independent. There should never be an occasion to use those commands in the normal course of working the assignments here.

There are obviously parts of the Jupyter UI that I have not yet had occasion to explore. So I learned something today as well. :nerd_face: