answer
What type of function can be used to determine whether a number is even or odd?A. evenB. BooleanC. mathD. odd
answer
True/False: One of the drawbacks of a modularized program is that the only structure we could use is sequence structure.
answer
In a menu-driven program, what statement is used to determine and carry out the user's desired action?A. if-elif-elseB. forC. whileD. if-else
answer
Python comes with ________ functions that have been already prewritten for the programmer.A. standardB. built-inC. customD. library
Don’t waste time
You can get a custom paper by one of our expert writers.
Get your custom essay
Helping students since 2015
answer
What type of value is returned by the functions random and uniform?A. floatB. integerC. doubleD. number
answer
True/False: The hierarchy chart shows all the steps that are taken inside a function.
answer
True/False: Unlike other languages, in Python, the number of values a function can return is limited to one.
answer
A( n ) ________ chart is also known as a structured chart.A. flowB. hierarchyC. dataD. organizational
answer
True/False: The randrange function returns a randomly selected value from a specific sequence of numbers.
answer
What makes it easier to reuse the same code in more than one program?A. ProceduresB. ModulesC. FunctionsD. Mods
answer
True/False: The math function, atan(x), returns one tangent of x in radians.
answer
A variable's ________ is the part of a program in which the variable may be accessed.A. scopeB. globalC. argumentD. local
answer
True/False: To assign a value to a global variable in a function, the global variable must first be declared in the function.
answer
True/False: A function definition specifies what a function does and causes the function to execute.
answer
True/False: Boolean functions are useful for simplifying complex conditions that are tested in decision and repetition structures.
question
B. a function that will return a value back to the part of the program that called it
answer
A value-returning function is ________.A. a single statement that performs a specific taskB. a function that will return a value back to the part of the program that called itC. a function that receives a value when it is calledD. called when you want the function to stop
answer
True/False: Python function names follow the same rules for naming variables.
question
A. Import Random
answer
Which of the following statements causes the interpreter to load the contents of the random module into memory?A. import randomB. load randomC. download randomD. upload random
answer
True/False: A value-returning function is like a simple function except that when it finishes it returns a value back to the called part of the program.
answer
A set of statements that belong together as a group and contribute to the function definition is known as a( n ) ________.A. headerB. blockC. parameterD. return
answer
What is a group of statements that exists within a program for the purpose of performing a specific task?a. functionb. subtaskc. procedured. subprogram
answer
The first line in the function definition is known as the function _____.a. headerb. blockc. returnd. parameter
answer
The _____ design technique can be used to break down an algorithm into functions.a. subtaskb. blockc. top-downd. simplification
answer
A(n) _____ variable is created inside a function.a. globalb. constantc. definedd. local
answer
The _____ of a local variable is the function in which the variable is created.a. globalb. definedc. locald. scope
answer
A(n) _____ is any piece of data that is passed into a function when the function is called.a. globalb. argumentc. scoped. parameter
answer
A(n) _____ is a variable that receives an argument that is passed into a function.a. globalb. argumentc. scoped. parameter
answer
The _____ argument specifies which parameter the argument should be passed into.a. keywordb. localc. globald. string
answer
A(n) _____ variable is accessible to all the functions in a program file.a. keywordb. localc. globald. string
answer
A(n) _____ constant is a global name that references a value that cannot be changed.a. keywordb. localc. globald. string
answer
When a function is called by its name, then it is _____.a. executedb. locatedc. definedd. exported
answer
It is recommended that programmers should avoid using _____ variables in a program when possible.a. localb. globalc. string globald. keyword
answer
The Python library functions that are built into the Python _____ can be used by simply calling the function.a. codeb. compilerc. linkerd. interpreter
question
b. number = random.randint(1, 50)
answer
Which of the following will assign a random number in the range of 1 through 50 to the variable number?a. random(1,50) = numberb. number = random.randint(1, 50)c. randint(1, 50) = numberd. number = random(range(1, 50))
question
a. A random integer from 5 to 15, multiplied by 2, assigned to the variable x
answer
What is the result of the following statement?x = random.randint(5, 15) * 2a. A random integer from 5 to 15, multiplied by 2, assigned to the variable xb. A random integer from 5 to 15 assigned to the variable xc. A random integer from 5 to 15, selected in 2 steps, assigned to the variable xd. A random integer from 5 to 15, raised to the power of 2, assigned to the variable x
answer
In a value-returning function, the value of the expression that follows the key word _____ will be sent back to the part of the program that called the function.a. defb. returnc. sentd. result
answer
The Python standard library's _____ module contains numerous functions that can be used in mathematical calculations.a. mathb. stringc. randomd. number
answer
Which of the following functions returns the largest integer that is less than or equal to x?a. floorb. ceilc. lesserd. greater
question
a. The function get_num() is expected to return a value each for num1 and num2.
answer
What does the following statement mean?num1, num2 = get_num()a. The function get_num() is expected to return a value each for num1 and num2.b. The function get_num() is expected to return a value and assign it to num1 and num2.c. Statement will cause a syntax error.d. Statement will cause a run-time error
answer
Given the following function definition, what would the statement print magic(5) display?def magic(num):return num + 2 * 10a. 70b. 25c. Statement will cause a syntax error.d. Statement will cause a run-time error
answer
True/False: The function header marks the beginning of the function definition.
answer
True/False: A local variable can be accessed from anywhere in the program.
answer
True/False: Different functions can have local variables with the same names
answer
True/False: Python allows for passing multiple arguments to a function.
answer
True/False: To assign a value to a global variable in a function, the global variable must first bedeclared in the function.
answer
True/False: The value assigned to a global constant can be changed in the mainline logic
answer
True/False: One of the reasons not to use global variables is that it makes a program hard todebug.
answer
True/False: In Python, one can have a list of variables on the left side of the assignmentoperator
answer
True/False: In Python, there is no restriction on the name of a module file.
answer
True/False: In a menu-driven program, a loop structure is used to determine the menu item theuser selected.
answer
True/False: The math function, ceil(x), returns the smallest integer that is greater than orequal to x.