Which of the following is not true about the emissions() method of the Electric
ID: 3867816 • Letter: W
Question
Which of the following is not true about the emissions() method of the Electric class? a. It overloads Car's emissions() method. b. It uses one or more of the class's attributes. c. It overloads Diesel's emissions() method. d. All of the above are true. e. None of the above is true. What is the value of Car(20, 20) Diesel(40, 40)? a. True b. False c. This would cause an error. d. It depends on the memory addresses of the instances created. e. None of the above. Which of the following does Electric not inherit from Car? a. Car's constructor. b. Car's initialization function. c. Car's attributes. d. a and b e. b and c For questions 33-35, refer to the following code: 1. def mystery6(alist): 2. c = 0 3. ret = [] 4. for item in a list: 5. if item not in ret: ret.append(item) 7. else: 8. c += 1 9. return ret What does this mystery6() function do? a. Counts the number of occurrences of each item in a list. b. Sorts a list in ascending order. c. Selects all entries in a list that are positive ints. d. Removes all duplicate items from a list. e. None of the above. What would print(mystery6([1, 3, 2, 'a', 1, 3, 5, 'b']) display? a. 2 b. [1, 3, 2, 'a', 1, 3, 5, 'b'] c. [1, 3] d. [1, 3, 2, 'a', 5, 'b'] e. None of the above. Which of the following would most likely achieve the same result as the a. Calling enumerate(alist). b. Calling list(set(alist). c. Calling sorted(alist). d. Calling list(alist). e. None of the above.Explanation / Answer
1.All of the above is true
Because the emissions() method of the electric class will overload Car's emissions method and also it will iser more class atributes awith desiel emissions method.
2.Car(20,20)==Diesel(40,40)
This statement depends on the memory addreseses of the instances created
Because we cannot predict this statement to be false or true because it totally depends on the memory addresses of the instances.
3.Both B and C
This statements are true because the initialization function and the attributes are inherit from the car but the constructor cannot be inherit.
4.selects all the enteries in a list that are positive ints.
Becaue the given function is a LIST and it is going to iterate all the values present in the list and increse the value to 1.
5.it will going to bind the values [1,3,2,'a',5,'b']
6.calling list(alist) is the function going to be return the same result produced by the previovs function.
Hope this will helps you.....
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.