Week 2 Assignment len(d["costs"])

I don’t get it. For the test of model(), how come the length of costs is 1 here? Shouldn’t it suppose to be an array and appends the cost of every 100 iterations of optimize() ? This is what the code in optimize() does.

Yes, that’s right, but the question is how many iterations you do, right? What this means is probably that you have “hard-coded” the value for number of iterations that you are passing from model to optimize. That means you are ignoring the actual input value, which for that test case only asks for 50 iterations and thus one cost value.