exam questions

Exam PCAP-31-03 All Questions

View all questions & answers for the PCAP-31-03 exam

Exam PCAP-31-03 topic 1 question 1 discussion

Actual exam question from Python Institute's PCAP-31-03
Question #: 1
Topic #: 1
[All PCAP-31-03 Questions]

What is true about Python packages? (Choose two.)

  • A. a code designed to initialize a package’s state should be placed inside a file named init.py
  • B. a package’s contents can be stored and distributed as an mp3 file
  • C. __pycache__ is a folder that stores semi-compiled Python modules
  • D. the sys.path variable is a list of strings
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Abbribas
1 week, 1 day ago
Selected Answer: CD
A > __init__.py B > Python packages are usually stored as .py, .pyc, .whl (wheel), or .tar.gz C > Python compiles .py files to bytecode and stores them as .pyc files in the __pycache__ folder to improve loading performance. D > sys.path is a list of directory paths (strings) that the interpreter searches for modules. So C & D
upvoted 1 times
...
Horsefeathers
5 months, 1 week ago
Selected Answer: CD
Agree with the others. The answer A has an incorrect file name (missing the underscores).
upvoted 2 times
...
thewoodsii81
7 months, 3 weeks ago
Selected Answer: AC
Besides the oversight of the naming issue for A this would be correct. D is wrong because sys.path is a variable and not a package
upvoted 1 times
...
SMMTechie
9 months, 1 week ago
C & D since init.py is not correct. _init_.py is the proper name. Google "init.py vs __init__.py" for confirmation.
upvoted 2 times
...
jarun2024
10 months ago
ANS: A&D
upvoted 1 times
...
DKAT2023
12 months ago
sorry, only C and D are corrects , for A the correct file name is _init_.py not init.py
upvoted 3 times
...
DKAT2023
1 year ago
A, C and D
upvoted 1 times
...
Damon54
1 year ago
A C e D are correct !!
upvoted 1 times
...
surendrapattipati
1 year, 1 month ago
A. a code designed to initialize a package’s state should be placed inside a file named init.py
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...