click below
click below
Normal Size Small Size show me how
SGD113Module2
Chapters 3 & 4
Question | Answer |
---|---|
Numbers generated with the _______ module are not truly random. | random |
When an if structure's condition is _______, its associated block is skipped. | false |
An ____ structure is useful for repeating a section of code | if |
In Python, using indentation to indicate code blocks is ________ | required |
Exactly one block of code of an __________ structure will always execute | if-elif-else |
Any value, of any type, can be treated as a ________ | condition. |
Liberal use of break and _______ statements can help make the logic of a loop less clear | continue. |
An _______ is something you write to plan the logic of a program | algorithm. |
What symbol is equivalent to the not equal to comparison operator? | != |
> is what kind of operator? | comparison |
not is what kind of operator? | Logical |
A(n) ____________________ operator compares two values. The result of such is either True or False. | comparison |
A(n) ____________________ condition is a larger condition formed by joining simpler conditions. | compound |
The ____________________ logical operator joins two conditions to form a single condition that’s False only if both original conditions are False. | or |
The ____________________ logical operator joins two conditions to form a single condition that’s True only if both original conditions are True. | and |
A section of code associated with a loop that’s executed while the loop’s condition is True. | body |
A set of clear, easy-to-follow instructions for accomplishing some task | algorithim |
C.A convention used for accessing part of an object, such as a function from a module | dot notation |
A file that contains code meant to be used in other programs. | module |
The process used to rewrite algorithms in more detail so that they’ | re ready |
for implementation. | stepwise refinement |
An expression that evaluates to either True or False. | condition |
Examining the execution of a program and its internal values in single steps. | block |
A section of code indented to form a single unit. | block |
Something between English and a programming language. | pseudocode |
The act of a program taking one path of code instead of another | branching |
________ are files that contain code meant to be used in other programs | modules |
_______ your programs, even the small ones, will almost always result in time (and often frustration) saved. | planning |
____________________ access is access to elements of a sequence in order. | sequential |
____________________ access is direct access to any element of a sequence. | random |
A(n) ____________________ is an element of a sequence | member |
The ____________________ operator tests for element membership in a sequence. | in |
The ____________________ function returns the length of a sequence | len() |
Another name for Unchangeable is ______ | immutable |
To move through a sequence, in order. | iterate |
An immutable sequence of values of any type. | tuple |
A name that is associated with a value not meant to be changed | constant |
A single item in a sequence | element |
A copy of a continuous section of a sequence | slice |
The process used to access a specific element of a sequence. | indexing |
An ordered list of elements | sequence |
Value that represents nothing. | none |
Another name for mutable is ______ | changeable |
The ______loop repeats part of your code based on a condition | while |
This type of looping structure will repeat part of a program based on an ordered list of things, repeating the loop body for each element of the sequence, in order. | for |
________ make programs clearer and save retyping and possibly errors from mistyping | constants |
_____ is a special value for representing nothing and evaluates to False when treated as a condition | none |
_________ can contain elements of any type | tuples |