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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post 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 34 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply