Hi @CoachDg,
These are some of the common mistakes I have seen learners make with the assignments of this course when they get these errors like these. See if you are doing the following:
- Not executing the cells - Learners often “write” code in the exercise cell which is correct, but they don’t execute/run that cell and instead execute the test cell directly.
Think of programming in this way: A computer/Jupyter notebook cannot see or read. It only does what you will ask it to do. When you write code and not execute that cell, the computer/notebook does not know what is written in it (this is often why errors like NameError: name ‘requested_book’ is not defined
appear). Only when you execute the cells, all the variables are initialised for the computer/notebook to know what’s in it, what is it that you want it to do. So the solution to this is that you have to run/execute the exercise cells before you run/execute the test cells.
- Not executing all of the notebook cells - Learners often start working on the assignment and then take a break. After the break they re-open the assignment and resume their work from where they left it. This approach is also incorrect because of reasons described in (1), because all of the executions you made previously are forgotten by the computer/notebook, even when the outputs of the cells is being displayed in the notebook.
Let’s say, you had worked your way up to exercise 2 when you decided to take a break. After the break you come back and start executing/running the cells of exercise 3 directly. You will see errors because the computer/notebook doesn’t remember what had happened before. So the solution to this is, every time you resume your work, you have to run all of the notebook cells from top to bottom before continuing with your work. So in the example I gave you, you have to run all of the cells before exercise 3 in order to continuing working from exercise 3 onwards.
I hope what I explained made sense. Try these solutions, and if your issues remain, let me know.
Best,
Mubsi