Tell us what’s happening:
The probability calculator is resulting 0.061. From what I read on the guide:
- I will randomize values from the class’s hats and remove the randomized values from the hats (I deep copied the contents of the hat class and removed one by one the values of the randomized from the copy). This loop will go on until the specified N, and if the hat’s length becomes less than the M I will reset hat’s content as it was so it would start over.
- Whenever the copied content becomes the same as the expected, I increase the count by 1.
I’m doing this, it’s counting 61 and when it divides by 1000 it’s becoming 0.061. But I know that’s incorrect, and I just couldn’t find an answer. Maybe I understood it wrong from the guide? Lmk, thanks in advance
Your code so far
Your browser information:
User Agent is:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
Challenge: Scientific Computing with Python Projects - Probability Calculator
Link to the challenge: