Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam PCAP topic 1 question 78 discussion

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

A Python module named pymod.py contains a function named pyfun().
Which of the following snippets will let you invoke the function? (Choose two.)

  • A. import pymod pymod.pyfun()
  • B. from pymod import pyfun pyfun()
  • C. from pymod import * pymod.pyfun()
  • D. import pyfun from pymod pyfun()
Show Suggested Answer Hide Answer
Suggested Answer: AB 🗳️
Reference:
https://www.tutorialsteacher.com/python/python-module

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
macxsz
2 years ago
Selected Answer: AB
A. import pymod pymod.pyfun() B. from pymod import pyfun pyfun()
upvoted 1 times
...
Norasit
2 years ago
There is no any correct answer if each statement write in a single line.
upvoted 1 times
...
rocky48
2 years, 1 month ago
pymod.py file contains => pyvar = 1 def pyfun(): print(pyvar) python3 => >>> import pymod >>> pymod.pyfun() 1 >>> from pymod import pyfun >>> pyfun() 1 >>> from pymod import * >>> pymod.pyfun() 1 >>> import pyfun from pymod File "<stdin>", line 1 import pyfun from pymod ^ SyntaxError: invalid syntax A,B, C are all correct. But B is better than C. Best answer : A & B
upvoted 2 times
zantrz
3 months, 2 weeks ago
for C we would require 3 lines, therefore I think is incorrect: import pymod from pymod import * pymod.pyfun()
upvoted 1 times
...
...
DTL001
2 years, 5 months ago
Yes, it's AB
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 ...