Exam PCAP-31-03 All QuestionsBrowse all questions from this 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.)

    Correct Answer: B, C

    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
DKAT2023Options: BC

B and C are corrects

Dave304409Options: BC

is correct