Course 1 Week2: Programming Assignment Exercise 4 (Assertion Error)

I am getting this Error however I have tried to assign

b=0.0 still gives error and even I tried with this

b = np.zeros((dim, 1), dtype=float)

Could you please help? I have been stuck, yes I understand definitely there is a mistake, please identify the issue in the coad so the issue may resolved.

I would appreciate for a prompt reply.


Hello, As I observe in the image you have not given the additional brackets for ((dim, 1)) and as mentioned b must be scalar and float but not a vector.
It will work even not then try to print the data type, if you are getting float then I think there will be no problem. I used b = 0. .

thank so much, it is working when I changed b=0.0

@umaradeel: My guess is that the first time you tried b = 0.0, you must not have executed the new function. Just typing new code does not take effect until you actually execute that cell by clicking “Shift - Enter”. Just calling the function again without doing that runs the old code. You can easily prove to yourself how this works. Give it a try!