A namespace is:
a space in which names exist
If you want to import pi from math, which line will you use?
from math import pi
Which one of the following is true?
packages contain modules
What can you do to indicate that a module entity should be treated as private?
A. you can mark the entity name with the _ (single underscore) prefix
B. you can mark the entity name with the __ (double underscore) prefix
A PWG-lead repository, collecting open-source python code is called:
PyPl
PyPl i often referred to as:
Cheese Shop
The name pip comes from:
pip installs packages
What is true about pop?
A. it’s a command-line tool
B. there are two different pip implementations, one for Python 2 and the other for Python 3
When you use pip to install a package that requires one or more dependencies, then:
pip will take care of everything by itself
Which of the following commands will you use to determine your pip version
A. pip -version
B. pip version
C. pip –version
The pip install command presents a list of:
locally installed packages
from random import randint
for i in range (2):
print(randint(1, 2), end=” “)
prints a number 2 times with a randomly generated num between 1 and 2, with only a space between the 2 singular numbers
11, 12, 21, or 22
the pyc file contains:
compiled Python code
What is true about updating already installed Python Packages?
its performed by the install command accompanied by the -U option
use -U to update an existing package
During the first import of a module, Python deploys the pyc files in the directory called:
pycache
pyc = pycache
A predefined Python variable that stores the current module name is called:
name
a list of package’s dependencies can be obtained from pip using its command named:
show
How to use pip to remove an installed package?
pip uninstall package
Knowing that a function named fun() resides in a module named mod, and it has been imported using the following line:
import mod
Choose the way it can be invoked in your code:
mod.fun()
What is true about the pip install command
A. It allows the user to install a specific version of the package
B. it install a package per user only when the –user option is specified
a function which returns a list of all entities available in a module is called:
dir()
What is true about the pip search command?
A. all its searches are limited to locally installed packages
B. it searches through all PyPl packages
C.it needs working internet connect to work
Choose the true statements:
A. The version function from the platform module returns a string with your OS version
B. The system function from the platform module returns a string with your OS name
from a.b import c
causes the import of:
entity c from module b from package a