Python 03 Key Terms

import statement

allows you to import, or load, modules

modules

files that contain code meant to be used in other programs

random module

contains functions related to generating random numbers and producing random results

randint()

produces a random integer

dot notation

calling a function from an imported module by giving the module name, followed by a period, followed by the function call itself

can be used to access different elements of imported modules

dot notation

requires two integer argument values and returns a random integer between those two values, which may include either of the argument values

randint()

randrange()

produces a random integer

branching

making a decision to take one path or another

cryptography

used to encode information so that only the intended recipients can understand it

condition

an expression that is either true or false

admiral ackbar

the foremost military commander of the Rebel Alliance who led major combat operations against the Galactic Empire

0

equal to comparison operator

!=

not equal to comparison operator

>

greater than comparison operator

<

less than comparison operator

>=

greater than or equal to comparison operator

<=

less than or equal to comparison operator

a block

one or more consecutive lines indented by the same amount

if statement(s)

statement or group of statements that gets executed if the condition is True

if<condition>: <block>

if statement. if <condition> is true, <block> is executed; otherwise it's skipped

if<condition>: <block 1>else: <block 2>

if statement with else clause. if <condition> is true, <block1> is executed; otherwise <block2> is executed

if<condition 1>: <block 1>elif<condition 2>: <block 2>...elif<condition N>: <block N>else: <block N+1>

if statement with elif clauses and optional final else clause. the block of the first true condition is executed. if no condition is true, the optional else clause's block is executed.

sentry variable

a variable used in the condition and compared to some other value or values

loop

a control construct for executing portions of a program multiple times

infinite loop

a loop that never stops

tracing

simulate the running of your program and do exactly what it would do, following every statement and keeping track of the values assigned to variables

continue

statement used to "jump back to the top of the loop

break

statement used to "break out of a loop

simple conditions

comparisons where exactly two values are involved

compound conditions

simple conditions combined with logical operators that allow programs to be able to make decisions based on how multiple groups of values compare

database management systems (DBMS)

allow you to organize, access, and update related information.

algorithm

a set of clear, easy-to-follow concrete list of steps to follow in order for accomplishing some task--an outline for your program

pseudocode

generally used for writing algorithms, usually falls somewhere between English and a programming language

stepwise refinemenet

one process used to rewrite algorithms so that they're ready for implementation to "make it more detailed

guessing loop

a loop that executes as long as the player hasn't correctly guessed the computer's number

the key to changing the flow of a program

the computer's ability to evaluate conditions

if, if-else, and if-elif-else statements

allow programs to make a decision

encryption

the process of encoding the information to keep it private

counted loop

a loop written to iterate a specific number of times

event-driven

a style of programming in which the program waits for events to happen and responds accordingly

input, process, output

a common programming pattern. the program prompts for input, processes it, and outputs a response

newline

a special character that marks the division between lines in a file or a multiline string. in Python, it is denoted "\n