Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following class definition and function for problems 28 and 29. cla

ID: 3583387 • Letter: C

Question

Consider the following class definition and function for problems 28 and 29. class Bucket: represents a bucket that stores water water 0 amount of water capacity 10 max vater it can store def new Bucket (w, c) bucket Bucket bucket water bucket capacity c return bucket 28) What will the following print to the console (screen)? buckets for i in range (3) buckets append new Bucket (i, 2 i total for bucket in buckets: bucket. Water total print (total) a) 0 29) What will the following print to the console (screen)? bl newBucket 12, 5) Bucket b2 capacity bl .water 3 b2 water capacity-bl Water print b2 water capacity a) 2 5 b) 36 c) 46 30) Consider the following code that opens a file called 'input tor and reads the fle inebywne. fname input.txt missing line for line in file: print (line) close (file)

Explanation / Answer

28)answer :b

3

29)answer: c

4 6

30)answer: file = open(fname,"r")

31)answer: a

3

32)answer: b

{1:10,2:20,3:30}

33)answer: a

[6, 8, 4]

34)answer:non of the above

35)answer:b

9

36)answer:b

6

37)answer:a

3

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote