Problem with compute_cost

I wrote this for the function compute_cost but I haven’t the good final cost (I have 0.6926 and not 0.6930). it is the same formula as above, in the explanations.

I can’t understand why. Do you have any tips or explications? This error makes me have 75/100 instead of the desired 80/100.

(Solution code removed by staff)

Hi @Sandro_Gazzo,

Sharing solution code publicly is against the honour code (hence I have removed the screenshot from your original post). You can share the errors publicly.

I understand there are instances where to help out you to have to look at the solution code. For such a scenario, staff or the mentors will specifically ask you to DM them your notebook. Unless that happens, please refrain from sharing solution code publicly.

Now. Can you share your lab ID with me ? So I could help you out. In the assignment, when you click the top right “Help” button, a panel will open and your lab ID will be shown at the bottom.

I shall take a look.


Hello @Mubsi ,

Sorry I didn’t know for the screenshots.

My ID is qxxpsjjv.

Thank you for yout help.


Finally, I solved my problem.

Thank you.