Certified Associate in Python Programming (PCAP-31-03) — Question 91
What is true about Python packages? (Choose two.)
Answer options
- A. a package can be stored as a tree of sub-directories/sub-folders
- B. __pycache__ is the name of a built-in variable
- C. the __name__ variable content determines the way in which the module was run
- D. hashbang is the name of a built-in Python function
Correct answer: A, C
Explanation
Option A is correct because Python packages are indeed organized as a hierarchy of directories. Option C is also correct as the value of the __name__ variable indicates how the module is executed, either as the main program or imported as a module. Options B and D are incorrect as __pycache__ is not a variable but a directory for cached bytecode, and hashbang is not a built-in function but rather a convention for indicating the interpreter in script files.