Dear all, I struggle on solving the provided task. The hat experiment returns “Probability: 0.22666666666666666” as the result, not the expected one.

Can someone help me out?

Here is my code for this part:

```
def experiment(hat, expected_balls, num_balls_drawn, num_experiments):
raw_str = str(hat).split(",")
data = raw_str[:-2]
experiment_data = []
exp_balls = []
for key in expected_balls:
for x in range(expected_balls[key]):
exp_balls.append(key)
for x in range(num_experiments):
temp_data = data.copy()
temp_balls_drawn = copy.copy(num_balls_drawn)
experiment_data.append([])
for y in range(temp_balls_drawn):
rdn = random.randint(0, len(temp_data)-1)
experiment_data[x].append(temp_data[rdn])
del temp_data[rdn]
counter = 0
for x in experiment_data:
fits = copy.copy(exp_balls)
for y in x:
if y in fits:
fits.remove(y)
if fits == []:
counter += 1
break
return (counter / num_experiments)
```

I would strongly appreciate a hint or a correction.

Thank you !!!