C1_w2 programming assignment error

{moderator edit: code removed}

what the error is and how to solve it plz anyone!!

Hi @Yaseen_Ali1,

Please note, you are not allowed to post code in forums as it is against community guidelines.

Coming to the problem, please compute each term separately as given in the formula. and it should be return dj_dw, dj_db instead of return dj_db, dj_dw.

Regards,
Mujassim

Both computations can share the same for-loop, I don’t see a problem with that.

Changing the order of the return values is certainly a problem.

I have edited the OP to remove the code.

If a mentor needs to see your code, we’ll ask you to send it via a private message. Just posting your error messages and the assert log is sufficient.

[EDIT: I realized I switched how dj_db and dj_dw were calcualted in the function. This was an error on my end.]

I came across the same error. I had to switch the return order in compute_gradient(). Instead of return dj_dw, dj_db I switched to return dj_db, dj_dw. This does not make sense but the unit tests passed and my submission at the end was 100%. Can someone explain if this is some type of bug?

1 Like

Hi @jairus-m!

You have to write your code between two lines:

### START CODE HERE ###

### END CODE HERE ###  

You don’t need to change any other code or write anywhere else.

I don’t get this. Are you saying that you passed the test with the wrong order, return dj_db, dj_dw?