nerdexam
Python_Institute

PCAP-31-03 · Question #19

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?

The correct answer is C. ClassA.__module__ == '__main__'. See the full explanation below for the reasoning.

Question

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?

Exhibit

PCAP-31-03 question #19 exhibit

Options

  • Astr(Object) == 'Object'
  • Bname == 'code.py'
  • CClassA.module == 'main'
  • Dlen(ClassB.bases) ==2

How the community answered

(29 responses)
  • A
    17% (5)
  • B
    3% (1)
  • C
    69% (20)
  • D
    10% (3)

Community Discussion

No community discussion yet for this question.

Full PCAP-31-03 Practice