Scientific Computing with Python Projects - Probability Calculator

Hello Guys,

I am dealing with probability calculator in scientific computing path.
I think I did a decent job with my code as it roughly works.
Nevertheless, I get error about the probability computed with test cases.
Here is my code:

Code

Do you see any evident mistake in the code?
I am puzzled because it seems pretty “linear” to me…

solution: boilerplate-probability-calculator - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Challenge: Scientific Computing with Python Projects - Probability Calculator

Link to the challenge:

1 Like

Since your probability is low, that means you are either doing the draw incorrectly or the experiment incorrectly and classifying some good results as bad. Since the draw tests pass, start by logging both the good and the bad results in the experiment along side the drawn balls and expected balls to find the cases that are good but are classified as bad.

Line 32 seems suspect to me. Take a look at how you’re comparing the lists again.