BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Python Institute Exam PCAP-31-03 Topic 6 Question 74 Discussion

Actual exam question for Python Institute's PCAP-31-03 exam
Question #: 74
Topic #: 6
[All PCAP-31-03 Questions]

Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Select two answers)

Show Suggested Answer Hide Answer
Suggested Answer: C, D

Contribute your Thoughts:

Ernest
1 months ago
I'm not sure about option D, but I think option B might also evaluate to True because it compares a private variable in class C.
upvoted 0 times
...
Deonna
1 months ago
This is a tricky one, but I think the key is understanding how Python's name mangling works. B and D are the way to go, in my opinion.
upvoted 0 times
...
Tammi
2 months ago
Ha! This question is a bit of a gotcha. I bet the exam writer is trying to trip us up with that private variable access. I'll go with C and D to play it safe.
upvoted 0 times
...
Francis
2 months ago
Hmm, I'm not sure about B. Isn't accessing private variables a bit of a code smell? I'd go with C and D as the correct answers.
upvoted 0 times
Glen
9 days ago
Definitely, C and D seem like the most logical choices.
upvoted 0 times
...
Georgiann
23 days ago
I would choose C and D as well.
upvoted 0 times
...
Carmen
28 days ago
I agree, accessing private variables can be a code smell.
upvoted 0 times
...
Gerald
1 months ago
I think C and D are the correct answers.
upvoted 0 times
...
...
Howard
2 months ago
I agree with An. Option A checks if obj_b is an instance of class C, and option D checks if obj_c.get() returns 2.
upvoted 0 times
...
An
2 months ago
I think option A and option D evaluate to True.
upvoted 0 times
...
Charlene
2 months ago
I think B and D are the correct answers here. C's private variable _VarA is being accessed correctly, and obj_c's get() method returns 2, so those expressions should evaluate to True.
upvoted 0 times
Mee
2 months ago
Yes, accessing C's private variable and obj_c's method return value of 2.
upvoted 0 times
...
Edelmira
2 months ago
I agree, B and D are the correct answers.
upvoted 0 times
...
...

Save Cancel