Make a class for drawing balls from a hat. Consider the example about drawing colored balls from a hat in Chapter 8.3.3. It could be handy to have an object that acts as a hat:
Realize such code with a class Hat. You can borrow useful code from the balls_in_hat.py program and ideas from Chapter 8.2.5. Use the Hat class to solve the probability problem from Exercise 8.4. Name of program file: Hat.py.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here