Filters
Question type

Study Flashcards

What are two common methods by which functions serve as abstraction mechanisms? (Choose two.)


A) The elimination of redundant, or repetitious code.
B) The availability of detailed docstring data.
C) The hiding of complicated processes.
D) The use of a bottom-up approach to design.

E) All of the above
F) A) and B)

Correct Answer

verifed

verified

In a recursive function, what is used to determine whether to stop or to continue with another recursive step?


A) terminator value
B) base case
C) recursion factor
D) step counter

E) None of the above
F) A) and D)

Correct Answer

verifed

verified

When you design an algorithm, it should be general enough to provide a solution to many problem instances, not just one or a few of them.

A) True
B) False

Correct Answer

verifed

verified

What is the lambda function in Python utilized for?


A) It allows for the creation of an anonymous function, which contains the names of its arguments and a single expression.
B) It creates an overloaded function, such that the function can be repurposed on the fly.
C) It allows for the tracking of use of a targeted function.
D) It allows for multiple higher-order functions to be utilized on the same selection statements.

E) C) and D)
F) None of the above

Correct Answer

verifed

verified

Most recursive functions expect no arguments.

A) True
B) False

Correct Answer

verifed

verified

The first five numbers of the Fibonacci sequence are 1 3 5 8 13.

A) True
B) False

Correct Answer

verifed

verified

In what higher-order function do you apply a predicate to each value within a list, and if the predicate returns true, the value is added to an object?


A) mapping
B) filtering
C) reducing
D) associating

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

What higher-order function process applies a function to each value in a sequence and returns a new sequence of the results?


A) mapping
B) filtering
C) reducing
D) associating

E) All of the above
F) A) and D)

Correct Answer

verifed

verified

A program's namespace is the set of its variables and their values.

A) True
B) False

Correct Answer

verifed

verified

What happens when a function tries to assign or change a value of a variable that has been defined at the module level?


A) The function succeeds, because the module variable is considered global in scope.
B) The function succeeds, but the value is appended to the variable.
C) The function fails, and an out of scope error message is raised.
D) Python creates a temporary variable with the same name, and the value of that variable exists only within the scope of the function.

E) A) and D)
F) B) and D)

Correct Answer

verifed

verified

To get a better understanding of how recursion works, it is helpful to trace its calls.

A) True
B) False

Correct Answer

verifed

verified

The amount of memory needed for a loop grows with the size of the problem's data set.

A) True
B) False

Correct Answer

verifed

verified

What is the name for a diagram that shows the relationships among a program's functions and the passage of data between them?


A) data map
B) structure map
C) structure chart
D) program flowchart

E) B) and C)
F) A) and D)

Correct Answer

verifed

verified

In Python, what is the term that is used to describe the area of a program text in which an object name refers to a given value?


A) relation
B) relevance
C) lifetime
D) scope

E) A) and D)
F) C) and D)

Correct Answer

verifed

verified

The Fibonacci sequence is a series of values that can be easily calculated with what kind of function?


A) recursive function
B) repeating function
C) duplicating function
D) compounding function

E) B) and D)
F) All of the above

Correct Answer

verifed

verified

Like with an infinite loop, an infinite recursion eventually halts execution with an error message.

A) True
B) False

Correct Answer

verifed

verified

How does top-down design work?


A) A problem is solved by employing a large task force to evaluate the cause.
B) A problem is solved by redesigning and repurposing existing software.
C) A solution is created to solve a problem, and individual issues are resolved as they are encountered.
D) A problem is decomposed into smaller problems, which are gradually solved to produce a solution.

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

It is possible to construct any algorithm using only Python's built-in operators and control statements.

A) True
B) False

Correct Answer

verifed

verified

Which of the following statements are accurate? (Choose two.)


A) Parameters for a function receive values when they are declared.
B) When module variables are introduced in a program, they are immediately given a value.
C) A nested variable can assign value to a variable outside of its scope.
D) Temporary values receive their values as soon as they are introduced.

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

The assignment of roles and responsibilities to different actors in a program is known as what type of design?


A) role-based access design
B) responsibility-driven design
C) delegated assignment design
D) task abstraction design

E) A) and D)
F) C) and D)

Correct Answer

verifed

verified

Showing 21 - 40 of 50

Related Exams

Show Answer