Scientific Computing with Python Projects - Probability Calculator - draw function

Kia ora,

I am having difficulty with the Probability Calculator project.
I do not understand what the draw function is supposed to do. Is it meant to:
A) Draw n number of balls from the hat and then remove those balls from the class instance of the hat, then if the draw function is called again it is drawing from a smaller pool, then replacing the balls only when the draw function is called with a larger with a larger number than the hat has, or
B) Draw a ball from the hat, remove that ball from the balls available that call of draw(), draw another, remove that, n number of times, but don’t alter the number of balls in the hat in the class instance, so another call of the draw function is drawing on the same pool.
C) something else altogether

Your help would be greatly appreciated.


From the instructions

The Hat class should have a draw method that accepts an argument indicating the number of balls to draw from the hat. This method should remove balls at random from contents and return those balls as a list of strings. The balls should not go back into the hat during the draw, similar to an urn experiment without replacement. If the number of balls to draw exceeds the available quantity, return all the balls.

It appears to be similar to the A.

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