Help with Probability Calc Test 3

Tell us what’s happening:
I have been struggling to figure out why my probability calculator code is not able to pass the the third test. The probability it returns is too low relative to what the test is expecting. I made sure that the code is returning the correct amount of draws and that the checks for a match are not missing any actual matches. Any ideas on how to approach debugging and understanding where the logical error is?

Your code so far
This is my code so far:

please let me know if there is anything else I can provide to clarify.

Your browser information:

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

Challenge: Probability Calculator

Link to the challenge:

Could you explain how should work function refilling the hat with balls?

The idea of the function was to reset the content list back to before the draw took place

Yeah, but how does it do that?

oooh it appends all the arguments again into the list, making it longer than before

Thank you, I have come up with a solution that prevents the contents list from being modified as multiple draws are done

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.