Probability Calculator: so close! Problem with random.seed?

Hello everybody,
Concerning this project : Scientific Computing with Python Projects - Probability Calculator
In, with prob_calculator.random.seed(95), the result I get for test_prob_experiment() is 0.252 instead of 0.272.
With prob_calculator.random.seed(111), all tests pass, and the test_prob_experiment, in particular, passes with a lot of seeds.

Here is my code :
Thanks for enlightening me…

Hello and welcome to the freeCodeCamp community~!

The error seems to come from using the random.uniform generator, which is generating floating point numbers that you are rounding to the nearest int. When I modify that line to use the random.randint generator instead, the tests pass.

1 Like

Hurray :smiley:

Hence the very small impact on the result!

Thank you nhcarrigan

1 Like

Glad to help! Keep up the great work and happy coding! :purple_heart: