Certified Associate in Python Programming (PCAP-31-03) — Question 24

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.)

Answer options

Correct answer: A, D

Explanation

Option A correctly imports the function pyfun directly from pymod and calls it. Option D also works by importing the module and then calling the function with the full path. Options B and C are incorrect; B fails because it does not properly reference pymod, and C may not have pyfun in the current namespace due to the wildcard import.