exam 3 Flashcards
(43 cards)
a programmer will typically write Python code in a file, and then pass that file as input to the interpreter
script
a file containing Python code that can be imported and used by scripts, other modules, or the interactive interpreter.
module
A module being required by another program is often called a ____.
dependency
A dictionary of the loaded modules is stored in ____.
sys.modules
A ____ is simply a namespace that contains definitions from the module.
module object
____is a global string variable automatically added to every module that contains the name of the module.
__name__
A programmer can specify names to import from a module by using the ____ keyword in an import statement
from
The program below imports names from the ____ module, a Python standard library module that contains a number of algorithms for creating a secure ____ of a text message.
hashlib, hash
A ____ maps names to objects.
namespace
____ is the area of code where a name is visible.
Scope
The process of searching for a name in the available namespaces is called ____.
scope resolution
____ is the process of dividing a program into separate modules that can be developed and tested separately and integrated into a single program.
Modular development
Programs are written using ____, meaning a small amount of code is written and tested, then a small amount more (an incremental amount) is written and tested, and so on.
incremental development
To assist with the incremental development process, programmers commonly introduce ____, which are function definitions whose statements haven’t been written yet.
function stubs
One approach is to use the ____ keyword, which performs no operation except to act as a placeholder for a required statement.
pass
The ____ indicates that the function is not implemented and causes the program to stop execution.
NotImplementedError
The ____ includes various utilities and tools for performing common program behaviors.
Python standard library
Functions for creating and editing of dates and times objects
datetime
Functions for working with random numbers
random
Functions that create complete copies of objects
copy
Functions that get the current time, convert time zones, and sleep for a number of seconds
time
Mathematical functions
math
Operating system informational and management helper functions
os
System-specific environment or configuration helper functions
sys