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 Bucketholds some water''' water-0 capacity- 100 # amount of water the bucket

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!