C3_W1_Anomaly_Detection select_threshold function-Wrong best_epsilon. Expected: 0.04 got: 0.29

When I coded this function in this way:

{mentor edit: code removed

I passed the first and second test case but failed to pass the third test case:

I checked it and I find out that the minimum value of p_val is 0.29 which means the epsilon should start from 0.29 and increase in 0.00071 interval. Why the answer is 0.04 which is smaller than 0.29?

And please correct the mistakes in my code, thank you.

Please do not post your code on the forum. That is not allowed by the Code of Conduct. Posting any error messages or test results is OK.

If a mentor needs to see your code, we will contact you with instructions.

I have edited your post to remove the code.

Ok, I understand it, thank you.

Please check your personal messages for some tips.