33. (15 points) Please show what output results for the indicated lines using the following program class MyClass: def m
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
33. (15 points) Please show what output results for the indicated lines using the following program class MyClass: def m
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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!