Question: Python ASAP class myClass1 () : def init (self, paraml, param2=10) : self . param1 = paraml self . param2 = param2 self . param3
Python ASAP




class myClass1 () : def init (self, paraml, param2="10") : self . param1 = paraml self . param2 = param2 self . param3 = 100 What is the difference between the attributes self.param1, self.param2, and self.param3? a) The difference is that the attribute self.param3 is not really useful, because it's value is the same for all objects of the class. O b) All objects of type myClass will have the same value of the attribute self.param2 which is 10, and the same value of the attribute self.pamar3 which is 100. Only the value of the attribute self.param1 will be different for objects at the initialization. c) All objects of type myClass will have access to the attributes self.param1 and self.param3. However, some objects will have access to the attribute self.param2 if it was provided at the initialization, and some objects will not if it was not provided at the initialization.@ d) The value of the attribute self.param1 has to be provided at the initialization. But the value of the attribute self.param2 is optional. And the value of the attribute self.param3 cannot possibly be provided at the initialization What does function kabab do given that s is only a string? def kabab (s) : if len (s) > 0: last = s[-1] print (last, end="") print (last, end="") kabab (s [0 :-1]) a) The function checks if the string is palindrome and prints it backward b) The function prints a reversed version of string s. For example kabab('hello')- will print ollehO a] The function checks if the string is palindrome and prints it backward 6) ID] The function prints a reversed version of string 5. For example kababi'hello']~ will print olleh O c) The function prints a double reversed version of string 5. For example kababi'hello')- will print oolllleehh Q d) Given that s has n characters. The function prints the last character of string 5 (n+1) times separated by "". For instance kababi'hello')- will print 0 o o o o o 0 e) None of the above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
