Week 3 practice lab

Hi, @Ali_Mohamed_Ali_Abd

Now, this is a very interesting error that I have not seen here before. What you have done is you just called the function compute_cost_logistic again in the same function body this in programming is called recursion.

Many programming languages do support recursion, unlike Python which does support it but with a limit, as it limits the number of recursion calls to 1000 calls.

Now, for the solution, remove the function calls in the compute_cost_logistic function body remove the recursion, and try using loops to solve it. or a better option tries using NumPy it will be mush easier and in very few lines of code.

Also, after you removed the recursion and started implementing the solution using loops. try following this https://community.deeplearning.ai/t/general-code-debugging-tips/212979 if you still have errors.

Best Regards,
Moaz El-Essawey

1 Like