Free PCAP-31-03 Exam Braindumps (page: 2)

Page 1 of 37

What is true about Python packages? (Select two answers)

  1. the__name__variable content determines the way in which the module was run
  2. a package can be stored as a tree of sub-directories/sub-folders
  3. __pycache__is the name of a built-in variable
  4. hashbang is the name of a built-in Python function

Answer(s): B,C



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

  1. import pyvar from pymod pyvar = 1
  2. from pymod import pyvar = 1
  3. from pymod import pyvar pyvar ()
  4. import pymod pymod.pyvar = 1

Answer(s): A,D



Assuming that the code below has been executed successfully, which of the following expressions will always evaluate to True? (Select two answers)

import random
v1 = random. random()
v2 = random. random()

  1. len(random.sample([1,2,3],2)) > 2
  2. v1 == v2
  3. random.choice([1,2,3]) >=1
  4. v1 >= 1

Answer(s): B,C



With regards to the directory structure below, select the proper forms of the directives in order to import module_
(Select two answers)

  1. import pypack.module_a
  2. import module_a from pypack
  3. import module_a
  4. from pypack import module_a

Answer(s): A,D






Post your Comments and Discuss Python Institute PCAP-31-03 exam with other Community members:

PCAP-31-03 Discussions & Posts