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

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

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 (?) , you can switch to a simple comment.
Switch to a voting comment New
Avidulam
Highly Voted 4 years, 1 month ago
print(self.get()), B is the answer
upvoted 26 times
...
macxsz
Most Recent 1 year, 11 months ago
assuming indentation is correct: B. print (self.get())
upvoted 2 times
...
Norasit
2 years ago
IndentationError
upvoted 1 times
...
rocky48
2 years ago
Selected Answer: B
print(self.get()), B is the answer
upvoted 1 times
...
wacha1978
2 years, 6 months 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
2 years, 11 months ago
B is the answer
upvoted 1 times
...
Shini1
3 years ago
correct answer is B
upvoted 1 times
...
FR99
3 years, 6 months ago
The correct answer is 'B'
upvoted 1 times
...
Het_is_je_boy
3 years, 8 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
3 years, 10 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 ...