Question: 3. Consider the Bucket class defined below class Bucket: 'A Bucket holds some water''' water-0 capacity- 100 # amount of water the bucket can hold


3. Consider the Bucket class defined below class Bucket: "'A Bucket holds some water''' water-0 capacity- 100 # amount of water the bucket can hold # amount of water in the bucket Write a function total_water that takes a list of Buckets as input. The function will return the sum of all the water in all the buckets in the input list. For example, b ucki () b2 = Bucket() bl.water 12 b2.water8 calling total_water bl, b2] will return 20
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
