WK 1, Ex. 2: NameError when submitting to grade

That must mean that the problem is that you have accidentally damaged the notebook and removed some code (the second point that Saif made above). E.g. accidentally changed the cell that does the “import” commands to be a Markdown cell instead of a Code cell or something like that.

The best strategy is to get a clean copy of the notebook and start over. You can save your existing work and just carefully copy/paste that in. But be very careful only to modify the “YOUR CODE HERE” sections. Here’s a thread about how to get a clean copy.