Page 1 of 1

33. (15 points) Please show what output results for the indicated lines using the following program class MyClass: def m

Posted: Sat May 14, 2022 4:51 pm
by answerhappygod
33 15 Points Please Show What Output Results For The Indicated Lines Using The Following Program Class Myclass Def M 1
33 15 Points Please Show What Output Results For The Indicated Lines Using The Following Program Class Myclass Def M 1 (36.91 KiB) Viewed 35 times
33. (15 points) Please show what output results for the indicated lines using the following program class MyClass: def methodi(self, param_tuple): self.local_list = 11 for element in param_tuple: if element > 10: self.local_list.append(element) def method(self): self.sum_int=0 for element in self.local_list: self.sum_int += element return self.sum_int inst1 = MyClass() inst2 = MyClass() inst1.method1([1,2,3]) print(inst 1.local_list) # Line 1 inst1.method1([10,11,121) print(inst1.local_list) # Line 2 print(inst1.method2()) # Line 3 #inst2.method2() # Line 4 (a) What output is produced by Line 1 of the above program? (b) What output is produced by Line 2 of the above program? (c) What output is produced by Line 3 of the above program? (d) Line 4 is commented out. What result would occur if Line 4 were executed by the program.