Exam 3: Control Structures

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

In order to determine if a certain value is not in a particular list (or string), the membership operator not in can be used.

(True/False)
4.8/5
(39)

All iterative control needed in a program can be achieved by use of the while statement.

(True/False)
4.9/5
(35)

Match the descriptions with their terms: -implicit form of control

(Multiple Choice)
4.8/5
(34)

Which forms of control flow require the use of a condition?

(Short Answer)
4.7/5
(38)

A control statement is a statement that determines the control flow of a set of instructions.

(True/False)
4.9/5
(35)

Give an appropriate expression for each of the following: -To determine if the numbers 10 and 20 do not appear in a list of numbers named nums.

(Short Answer)
4.8/5
(33)

Construct multiway selection by use of nested if statements, based on variable n with an integer value in the range 1-100, so that if n is less than or equal to 30, "low value" is displayed; if n is greater than 30 and less than or equal to 60, "median value" is displayed; otherwise, "high value" is displayed.

(Essay)
4.8/5
(41)

Short-circuit evaluation is when a Boolean expression contains the invalid use of Boolean operators.

(True/False)
4.9/5
(37)

11. Statements that determine the flow of control of a set of instructions are called _____________________.

(Short Answer)
5.0/5
(40)

not (num == 0) and num != 0 are logically equivalent Boolean expressions, for integer value num.

(True/False)
4.7/5
(40)

The Boolean data type contains two Boolean values?

(True/False)
4.9/5
(35)

Give Python code that prompts the user to enter positive integer values, and continues to prompt the user until a value of -1 is entered, displaying whether there are more even numbers entered, more odd numbers entered, or the same number of even and odd numbers.

(Essay)
4.8/5
(32)

Sequential, selection and iterative control are all based on a given condition.

(True/False)
4.9/5
(44)

All Boolean operators are applied before any relational operators.

(True/False)
4.7/5
(28)

Give Python code that prompts the user to enter positive integer values, and continues to prompt the user until the Enter key is hit, adding up all the values entered and displaying the result.

(Essay)
4.8/5
(40)

As long as the condition of a while statements is true, the statements within the loop (its suite) are repeatedly executed.

(True/False)
4.8/5
(35)

Give Python code that prompts the user to enter a value between 1 and 5, displaying an error message if an invalid value is enterted and prompting the user to reenter.

(Essay)
4.9/5
(43)

A header in Python is

(Multiple Choice)
5.0/5
(36)

For each of the following Boolean expressions, indicate the value of x that would make each expression false. (a) x and True (b) x or False (c) not (x or False) (d) not (x and True)

(Short Answer)
4.8/5
(28)

Program that do not have any form of control flow other than sequential control are called__________________________.

(Short Answer)
4.9/5
(42)
Showing 81 - 100 of 129
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)