Week2 practice lab error

Hi.I have this error in my assignment W2C2. What should i do?

Hi @Hanieh_Hosseini

looks like the variable wasn’t define. Make sure you have running all the cells correctly and try again.

best regards


please refer to the hints given just below the grader cell. See what have missed based on the template code given at the start of the uploaded notebook. These assignment require you to just replace None with the right code with the help of hints given.

Make sure your variable like how @elirod mentioned has been recalled by the right code.

dj_dw and dj_db codes need to be written in single line code. So check your hints and find how you can write this code in single line.


1 Like

I get this error and can’t work out why… can anyone help please?

Hello Mathew,

Please make sure you have replaced all the None’s mention in the template code with the right code.

Refer the hint section just below the grader cell, to find your solution.


1 Like

i dont know what error and i check all answers exercises and check from the answers in practice lab all good and same answer what this error?

This thread has several items you can check.

(If the thread isn’t accessible to you, post back a message and I’ll copy the content here).

i make it

I don’t think posting a support ticket with the Coursera Help Center is going to help.

They don’t offer support for the course materials - only whether the web pages load in your browser.

Thanks DP - but I still can’t see the problem - which ‘None’s’ please

Hello Matthew Gaunt,

Kindly don’t post codes which is part of the grader cells. Kindly remove it.

Based on the codes you have shared.

Kindly compare with the template given at the beginning of uploading the assignment and the code lines you have added.

By editing the template code you have created format error

You are not suppose to paste codes from the hints section but to only find solution from those hints.


Hooray - passed that fist bit… no to my next error… anyone??

1 Like

no worries, fixed it! It’s all formatting, but I’m getting my head around it… slowly!

Good keep trying!!!


Please dont forget to save by file-> save and then submit the assignment. Sometimes your work is not auto-saved and you can end up with this error.

i checked the hints and did the exact same thing but it is wrong again.i don’t know what to do

Hello Hanieh,

Did you read and follow these instructions

to do the correction?

if yes and still getting error, then send me your codes for this grader cell via personal DM. Click on my name and then message.


Be sure that every time you open the notebook, you run all of the cells. That’s how the packages are imported and the data set is defined.

Hello Hanieh,

as discussed, the grader cell you sent has been added with extra two code line separately, but the grader wants you to write dj_dw and dj_db in a single code line based on the below image hint

if you notice in the image dj_db_i and dj_dw_i are given with codes but you need to write codes
dj_db +=
dj_dw +=

also from one more hint from the same section mentions
dj_db += dj_db_i, so based on this and the image shared dj_db += would be what? will it be not the same value mentioned for dj_db_i in the image mentioned which you wrote as a separate code line.
same goes for dj_dw += but for this you need to do little modification as it ia dj_dw_ij. can you try once? probably you will get the code in single line.

you do not need those extra code lines separately to be recalled dj_db_i and dj_dw_i in the grader cell.