**Tell us what’s happening:**

Hi! I’ve been stuck in this test for a couple of days and can’t find the solution.

```
======================================================================
FAIL: test_prob_experiment (test_module.UnitTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/boilerplate-probability-calculator/test_module.py", line 27, in test_prob_experiment
self.assertAlmostEqual(actual, expected, delta = 0.01, msg = 'Expected experiment method to return a different probability.')
AssertionError: 0.262 != 0.272 within 0.01 delta (0.010000000000000009 difference) : Expected experiment method to return a different probability.
----------------------------------------------------------------------
Ran 3 tests in 0.112s
FAILED (failures=1)
```

**Your code so far**

Link to replit

```
import copy
import random
# Consider using the modules imported above.
class Hat:
def __init__(self, **kwargs):
#The arguments passed into the hat are converted into a list of strings containing one item for each ball in the hat
self.contents = []
for k, v in kwargs.items():
for val in range(v):
self.contents.append(k)
self.contents
def draw(self, k):
#This method remove balls at random from contents and return those balls as a list of strings. The balls do not go back into the hat during the draw. If the number of balls to draw exceeds the available quantity, return all the balls.
if k > len(self.contents):
return self.contents
else:
contents_sample = random.sample(self.contents, k)
for i in range(len(contents_sample)):
self.contents.remove(contents_sample[i])
return random.sample(self.contents, k)
def experiment(hat, expected_balls, num_balls_drawn, num_experiments):
# Method to determine the probability of getting the exact group of balls(expected_balls) from the hat(hat), drawing out of the hat in each experiment a determined number of balls(num_balls_drawn) performed an indicated number of time performed(num_experiments)
m = 0 #Counts the number of time the expected balls are drawn out.
for i in range(num_experiments):
hat_copy = copy.deepcopy(hat)
expected_balls_copy = copy.deepcopy(expected_balls)
hat_sample = hat_copy.draw(num_balls_drawn)
# Controls the value of balls expected if all are drawn counts it
for i in expected_balls:
expected_balls_copy[i] -= hat_sample.count(i)
if all(value <= 0 for value in expected_balls_copy.values()):
m += 1
return m/num_experiments
```

**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:**