3073 Ch.5
In Python you can have a list of variables on the left side of the argument operator.
True
One reason not to use global variables is that it makes a program hard to debug.
True
A(n)_______is a piece of data that is sent into a function. 1. argument 2. parameter 3. header 4. packet
1. argument
When possible, you should avoid using______variables in a program. 1. local 2. global 3. reference 4. parameter
2. global
One reason to store graphics functions in a module is so that you can import the module into any program that needs to use those functions.
True
This is a prewritten function that is built into a programming language. 1. standard function 2. library function 3. custom function 4. cafeteria function
2. library function
A design technique that helps to reduce the duplication of code within a program and is a benefit of using functions is 1. code reuse 2. divide and conquer 3. debugging 4. facilitation of teamwork
1. code reuse
This standard library function returns a random floating-point number in the range of 0.0 up to 1.0 (but not including 1.0). 1. random 2. randint 3. random_integer 4. uniform
1. random
A design technique that programmers use to break down an algorithm into functions is known as 1. top-down design 2. code simplification 3. code refactoring 4. hierarchical subtasking
1. top-down design
This is a design tool that describes the input, processing, and output of a function. 1. hierarchy chart 2. IPO chart 3. datagram chart 4. data processing chart
2. IPO chart
You_________a function to execute it 1. define 2. call 3. import 4. export
2. call
A______is a variable that is created inside a function. 1. global variable 2. local variable 3. hidden variable 4. none of the above; you cannot create a variable inside a function
2. local variable
A(n)_______is a special variable that receives a piece of data when a function is called. 1. argument 2. parameter 3. header 4. packet
2. parameter
This standard library function returns a random integer within a specified range of values. 1. random 2. randint 3. random_integer 4. uniform
2. randint
This type of function returns either True or False. 1. Binary 2. true_false 3. Boolean 4. logical
3. Boolean
A group of statements that exist within a program for the purpose of performing a specific task is a(n)___________ . 1. block 2. parameter 3. function 4. expression
3. function
A(n) _______is the part of a program in which a variable may be accessed. 1. declaration space 2. area of visibility 3. scope 4. mode
3. scope
This is a math module function. 1. derivative 2. factor 3. sqrt 4. differentiate
3. sqrt
A variable that is visible to every function in a program file is a________. 1. local variable 2. universal variable 3. program-wide variable 4. global variable
4. global variable
The first line of a function definition is known as the 1. body 2. introduction 3. initialization 4. header
4. header
A__________ is a diagram that gives a visual representation of the relationships between functions in a program. 1. flowchart 2. function relationship chart 3. symbol chart 4. hierarchy chart
4. hierarchy chart
This statement causes a function to end and sends a value back to the part of the program that called the function. 1. end 2. send 3. exit 4. return
4. return
This standard library function returns a random floating-point number within a specified range of values. 1. random 2. randint 3. random_integer 4. uniform
4. uniform
A hierarchy chart shows all the steps that are taken inside a function.
False
A local variable can be accessed from anywhere in the program.
False
Unlike other languages, in Python the number of values a function can return is limited to one.
False
A value-returning function is like a simple function except that when it finishes it returns a value back to the part of the program that called it.
True
Python function names follow the same rules as those for naming variables.
True
The math function ceil(x) returns the smallest integer that is greater than or equal to x.
True
To assign a value to a global variable in a function, the global variable must be first declared in the function.
True