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

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

Assuming that the code below has been placed inside a file named code.py and executed successfully, which of the following expressions evaluate to True?
(Choose two.)

  • A. ClassA.__module__ == '__main__'
  • B. __name__ == '__main__'
  • C. str(Object) == 'Object'
  • D. len(ClassB.__bases__) == 2
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
macxsz
Highly Voted 2 years, 7 months ago
True: A. ClassA.__module__ == '__main__' B. __name__ == '__main__'
upvoted 10 times
...
Damon54
Most Recent 9 months, 2 weeks ago
There are at least 45 completely wrong questions in this dump!!!!! be careful
upvoted 2 times
...
seaverick
10 months ago
Selected Answer: AB
class ClassA: var = 1 def __init__(self, prop): prop1 = prop2 = prop class ClassB(ClassA): def __init__(self, prop): prop3 = prop ** 2 super().__init__(prop) def __str__(self): return 'Object' Object = ClassA(2) print(ClassA.__module__ == '__main__') print(__name__ == '__main__') #print(str(Object) == 'Object')#TypeError: '_io.TextIOWrapper' object is not callable print(len(ClassB.__bases__) == 2) Ans is A,B
upvoted 1 times
...
kstr
1 year ago
AB tested
upvoted 1 times
...
Amfortas
2 years, 2 months ago
Selected Answer: AB
A and B are True
upvoted 3 times
...
Jnanada
2 years, 3 months ago
A & B are true
upvoted 3 times
...
simplex06
2 years, 4 months ago
class ClassA: var = 1 def __init__(self, prop): prop1 = prop2 = prop class ClassB(ClassA): def __init__(self, prop): prop3 = prop ** 2 super().__init__(prop) def __str__(self): return 'Object' Object = ClassA(2) A and B are True
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 ...