Certified Associate in Python Programming (PCAP-31-03) — Question 88
What is true about Python packages? (Choose two.)
Answer options
- A. a package is a single file whose name ends with the pa extension
- B. a package is a group of related modules
- C. the __name__ variable always contains the name of a package
- D. the pyc extension is used to mark semi-compiled Python packages
Correct answer: B, D
Explanation
Option B is correct because a package in Python is indeed a collection of related modules that are organized in a directory. Option D is also correct as the .pyc extension is used for compiled Python files, which can be considered semi-compiled packages. Options A and C are incorrect; a package is not a single file ending with the .pa extension, and the __name__ variable does not always contain the name of a package.