Certified Associate in Python Programming (PCAP) — Question 83

A Python module named pymod.py contains a variable named pyvar.
Which of the following snippets will let you access the variable? (Choose two.)

Answer options

Correct answer: A

Explanation

Option A is correct because it correctly imports the pymod module, allowing access to its variable pyvar. The other options are incorrect: B incorrectly attempts to import pyvar directly, C improperly tries to call pyvar as a function, and D imports from a different module, pyfun, which does not contain pyvar.