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 101 discussion

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

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

  • A. isinstance (obj_b,A)
  • B. A.VarA == 1
  • C. obj_a is obj_aa
  • D. B.VarA == 1
Show Suggested Answer Hide Answer
Suggested Answer: AB 🗳️

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
kontra
1 year, 8 months ago
Selected Answer: AB
Correct Answer : A,B
upvoted 1 times
...
9prayer
1 year, 9 months ago
Selected Answer: AB
Correct Answer : A,B
upvoted 1 times
...
Jnanada
2 years, 3 months ago
Correct Answer : A,B
upvoted 1 times
...
blacksmokerr
2 years, 5 months ago
Selected Answer: AB
this is a,b
upvoted 1 times
...
deckman
2 years, 6 months ago
Selected Answer: AB
A and B are correct ones
upvoted 1 times
...
macxsz
2 years, 6 months ago
Selected Answer: AB
A. isinstance (obj_b,A) B. A.VarA == 1
upvoted 2 times
...
macxsz
2 years, 7 months ago
A and B are the only True
upvoted 1 times
...
rocky48
2 years, 7 months ago
Selected Answer: AB
AB is correct
upvoted 1 times
rocky48
2 years, 7 months ago
>>> isinstance(obj_b, A) True >>> A.VarA == 1 True >>> obj_a is obj_aa False >>> B.VarA == 1 False
upvoted 2 times
...
...
Noarmy315
2 years, 10 months ago
AB is correct
upvoted 1 times
...
DTL001
2 years, 11 months ago
The correct answer is AB
upvoted 2 times
...
mazimir
3 years, 1 month ago
Its: True True False False
upvoted 4 times
Misco33
3 years ago
That's correct, try this code: class A: VarA = 1 def __init__(self) -> None: self.prop_a=1 class B(A): VarA = 2 def __init__(self) -> None: self.prop_b=2 obj_a = A() obj_aa = A() obj_b=B() obj_bb=B() print(isinstance(obj_b,A)) print(A.VarA==1) print(obj_a is obj_aa) print(B.VarA == 1)
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 ...