Exam PCAP-31-03 All QuestionsBrowse all questions from this exam
Question 3

A Python package named pypack includes a module named pymod.py which contains a function named pyfun().

Which of the following snippets will let you invoke the function? (Choose two.)

    Correct Answer: A, D

    To invoke the function pyfun() from the module pymod inside the package pypack, there are two correct approaches. The first approach is to directly import the function using 'from pypack.pymod import pyfun', which allows you to call pyfun() directly. The second approach is to import the package and the module separately using 'import pypack' and 'import pypack.pymod', then you can call the function using 'pypack.pymod.pyfun()'.

Discussion
Dave304409Options: AD

is correct

DKAT2023Options: AD

A and D