Gradient_check_n() takes from 4 to 5 positional arguments but 6 were given


In course 2 week 1, gradient_check_n() accepts 5 variables:
def gradient_check_n(parameters, gradients, X, Y, epsilon=1e-7):

however, in the next box for checking it has 6 inputs. I cannot remove True from it.
difference = gradient_check_n(parameters, gradients, X, Y, 1e-7, True)

Please let me know your suggestions.

It looks like you must have changed the function definition. Here’s what it looks like in my notebook:

# GRADED FUNCTION: gradient_check_n

def gradient_check_n(parameters, gradients, X, Y, epsilon=1e-7, print_msg=False):

That is the original code as it was given to you. If you changed other things and want to get a clean copy of the notebook to compare, there is a topic about that on the FAQ Thread.

Please note that a lot of the test cells in the notebook are intentionally made not editable. If the test fails, the solution is not to change the test: it is to figure out what is wrong with your code that causes it to fail the test.