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 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: AC 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
kontra
1 year, 1 month ago
Selected Answer: AB
Correct Answer : A,B
upvoted 1 times
...
9prayer
1 year, 2 months ago
Selected Answer: AB
Correct Answer : A,B
upvoted 1 times
...
Jnanada
1 year, 8 months ago
Correct Answer : A,B
upvoted 1 times
...
blacksmokerr
1 year, 10 months ago
Selected Answer: AB
this is a,b
upvoted 1 times
...
deckman
1 year, 11 months ago
Selected Answer: AB
A and B are correct ones
upvoted 1 times
...
macxsz
1 year, 11 months ago
Selected Answer: AB
A. isinstance (obj_b,A) B. A.VarA == 1
upvoted 2 times
...
macxsz
1 year, 12 months ago
A and B are the only True
upvoted 1 times
...
rocky48
2 years ago
Selected Answer: AB
AB is correct
upvoted 1 times
rocky48
2 years 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, 3 months ago
AB is correct
upvoted 1 times
...
DTL001
2 years, 4 months ago
The correct answer is AB
upvoted 2 times
...
mazimir
2 years, 6 months ago
Its: True True False False
upvoted 4 times
Misco33
2 years, 5 months 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 ...