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

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
macxsz
Highly Voted 2 years ago
True: A. ClassA.__module__ == '__main__' B. __name__ == '__main__'
upvoted 10 times
...
Damon54
Most Recent 2 months, 3 weeks ago
There are at least 45 completely wrong questions in this dump!!!!! be careful
upvoted 2 times
...
seaverick
3 months, 1 week 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
5 months, 3 weeks ago
AB tested
upvoted 1 times
...
Amfortas
1 year, 8 months ago
Selected Answer: AB
A and B are True
upvoted 3 times
...
Jnanada
1 year, 8 months ago
A & B are true
upvoted 3 times
...
simplex06
1 year, 9 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 ...