PCAP-31-03 Exam QuestionsBrowse all questions from this exam

PCAP-31-03 Exam - Question 23


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.)

Show Answer
Correct Answer: BC

Given the provided code and expressions, two of these evaluate to True. First, when a Python file is executed directly, the global variable '__name__' is set to '__main__', making option B true. Second, the expression 'len(ClassB.__bases__)' returns the number of base classes for 'ClassB'. In this case, 'ClassB' inherits from 'ClassA', meaning it has only one base class, which makes option C true.

Discussion

2 comments
Sign in to comment
DKAT2023Options: BC
Jun 29, 2024

B and C are corrects

Dave304409Options: BC
Jul 4, 2024

is correct