The problem is that indentation is part of the syntax of python. The way you wrote the logic, you are calling linear_activation_forward twice in each iteration of the loop.
BTW the rules are that we aren’t supposed to publicly share source code, so we’re not supposed to just post our code and say, in effect, “please fix it for me”.