PCAP Exam QuestionsBrowse all questions from this exam

PCAP Exam - Question 129


With regards to the directory structure below, select the proper forms of the directives in order to import module_b. (Choose two.)

Show Answer
Correct Answer: AB

To import module_b correctly given the directory structure shown, you must include the full package path. The two correct forms are 'from pypack.upper import module_b' and 'import pypack.upper.module_b'. Both of these options specify the path from the top-level package (pypack) down to module_b, ensuring the import will work correctly in Python.

Discussion

6 comments
Sign in to comment
macxszOption: A
May 4, 2022

A. from pyback.upper import module_b B. import pyback.upper.module_b

rotimislawOption: B
Nov 14, 2022

A. from pyback.upper import module_b B. import pyback.upper.module_b

NengggOption: A
Dec 11, 2022

A. from pyback.upper import module_b B. import pyback.upper.module_b

ivanbicalhoOptions: AB
Mar 2, 2023

It should be AB, the question is asking us to choose two, but the system is considering a solo answer wrongly.

DezzoPalYeahOptions: AB
Oct 10, 2023

Answer is AB.

seaverickOption: A
Feb 4, 2024

import pypack.upper.module_b #True #import upper.module_b #ModuleNotFoundError: No module named 'upper' from pypack.upper import module_b #import module_b #ModuleNotFoundError: No module named 'module_b' Ans -> AB