Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP All Questions

View all questions & answers for the PCAP exam

Exam PCAP topic 1 question 70 discussion

Actual exam question from Python Institute's PCAP
Question #: 70
Topic #: 1
[All PCAP Questions]

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?

  • A. print (get(self))
  • B. print (self.get())
  • C. print (get())
  • D. print (self.get (val))
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Avidulam
Highly Voted 4 years, 8 months ago
print(self.get()), B is the answer
upvoted 26 times
...
macxsz
Most Recent 2 years, 7 months ago
assuming indentation is correct: B. print (self.get())
upvoted 2 times
...
Norasit
2 years, 7 months ago
IndentationError
upvoted 1 times
...
rocky48
2 years, 7 months ago
Selected Answer: B
print(self.get()), B is the answer
upvoted 1 times
...
wacha1978
3 years, 1 month ago
class C: def __init__(self, val): self.val = val def get(self): return self.val def show(self): print(self.get()) a = C(7) a.show() 7
upvoted 4 times
...
themeister
3 years, 6 months ago
B is the answer
upvoted 1 times
...
Shini1
3 years, 7 months ago
correct answer is B
upvoted 1 times
...
FR99
4 years, 1 month ago
The correct answer is 'B'
upvoted 1 times
...
Het_is_je_boy
4 years, 3 months ago
Should give a Error. Class is not with a capital letter + it has 3 _ should be 2 + wrong indentation.
upvoted 1 times
...
guillepowermetal
4 years, 5 months ago
correct answer is B
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...