Not all tests were passed for {}

In the Python Basic with Numpy homework
I got AssertionError: Not all tests were passed for sigmoid. Check your equations and avoid using global variables inside the function.

What happened to 1 line code?
def sigmoid(x):
“”"
Compute the sigmoid of x

Arguments:
x -- A scalar or numpy array of any size

Return:
s -- sigmoid(x)
"""

# (≈ 1 line of code)
# YOUR CODE STARTS HERE

s = 1 / (1 + np.exp(-x))

# YOUR CODE ENDS HERE

return np.exp(x)
1 Like

Your “1 line of code” is correct, but it looks like you also modified the returned value which is incorrect.

oh, I got it, my mistake now it got passed, Thanks you :)