Python_Institute
PCAP-31-03 · Question #102
The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns. Which of the invocations should be used instead…
The correct answer is B. print (self.get()). See the full explanation below for the reasoning.
Question
The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns. Which of the invocations should be used instead of XXX?
Exhibit
Options
- Aprint (get(self))
- Bprint (self.get())
- Cprint (get())
- Dprint (self.get (val))
How the community answered
(42 responses)- A5% (2)
- B71% (30)
- C17% (7)
- D7% (3)
Community Discussion
No community discussion yet for this question.
