DLS course2 week 1 Initialization problem

Notice that there is no “return” statement in your function. That is why you get that “NoneType” error in the test cell: your function does not actually return anything. That was part of the template code and there should have been no reason to remove it. If it’s not obvious where to add the return, then please get a clean copy of the notebook and compare. There’s a topic about how to do that on the DLS FAQ Thread.

Also note that is not the only problem with the code in that function. Please read the instructions and the “docstring” again about what the shape of W^{[l]} should be.