Build a Probability Calculator Project

Finally passed the last test! When rereading the requirements these words hit me “at least”.

I was testing for an exact match. I was counting success cases as only where the exact number of required balls are drawn. The test consider success even when a greater number of the required colour balls are drawn.

I consider the exact case to be more correct.

Also, there is a bit of a contradiction:

  • expected_balls: An object indicating the exact group of balls to attempt to draw from the hat …
  • … count how many times M you get at least two red balls …

That means your code might not function as you expected, you aim for checking exact balls, but the code in fact checks for ‘at least’…