Hi Guys. Can anyone explain to me why do I need to use the copy.deepcopy() when I’m using my class object inside the experiment function?
if I use the following, the code works:
for i in range(num_experiments):
hat_copy = copy.deepcopy(hat)
draw = hat_copy.draw(num_balls_drawn)
but, if I use the one bellow, the code starts to fail after a few iterations:
draw = hat.draw(num_balls_drawn)