Week 3 - Getting error in default code which is given by Coursera

That means something is wrong in either the code you wrote or that you perhaps don’t understand how the notebooks work. If you are getting undefined variables, then you have to debug that: what cell defines the missing variable? Did you run that cell? Did it throw an error or did it complete successfully? The main point is that you need to actually execute all the previous cells anytime you close and reopen the notebook or do something like “Kernel → Restart”. Even if you see the output of the previous run, the actual runtime code will not exist until you do “Cell → Run All Above” or “Cell → Run All”. There is a topic about this on the FAQ Thread.

1 Like