Course 1- Week 4- Assignment 1: Crucial function but can't get it correct!

The function “L_model_forward(X, parameters)” is central to the code but I can’t get it correct in any way!! Almost probably my problem is with: "Don’t forget to keep track of the caches in the “caches” list. To add a new value c to a list , you can use list.append(c)"
I am not forgetting to “keep track of the caches”! I just don’t know how to do it!! :slight_smile:
Any help will be appreciated.

They just told you, right? :nerd_face: I’m not supposed to actually write the code for you, but here’s another way to translate what they said in the instructions:

Suppose I have a list called myList and I want to add a new element called newElement to it. The code would be:


Note that there is no “assignment” statement involved there: this is “object oriented” programming. You are invoking the “append()” method on the object (list) in question.

So, I just replace “myList” and “newElement” by what is in the code :slightly_smiling_face:. That’s a clever way to help someone with a code without giving him the exact code :grin:.

1 Like