Chapter 2
This operator performs division, but instead of returning the quotient it returns the remainder. a. % b. * c. ** d. /
a. %
This operator performs integer division. a. // b. % c. ** d. /
a. //
An informal language that has no syntax rules and is not meant to be compiled or executed is called ___. a. faux code b. pseudocode c. Python d. a flowchart
b. pseudocode
. A _ is a single function that the program must perform in order to satisfy the customer. a. task b. software requirement c. prerequisite d. predicate
b. software requirement
A ___ is any hypothetical person using a program and providing input for it. a. designer b. user c. guinea pig d. test subject
b. user
. This is an operator that raises a number to a power. a. % b. * c. ** d. /
c. **
A ___ error does not prevent the program from running, but causes it to produce incorrect results. a. syntax b. hardware c. logic d. fatal
c. logic
A ___ is a sequence of characters. A. char sequence b. character collection c. string d. text block
c. string
. This symbol marks the beginning of a comment in Python. a. & b. * C. ** d. #
d. #
A(n) is a set of well-defined logical steps that must be taken to perform a task. a. logarithm b. plan of action c. logic schedule d. algorithm
d. algorithm
A string literal in Python must be enclosed in ___. a. parentheses. b. single-quotes. c. double-quotes. d. either single-quotes or double-quotes.
d. either single-quotes or double-quotes.
Short notes placed in different parts of a program explaining how those parts of the program work are called ___. a. comments b. reference manuals c. tutorials d. external documentation
a. comments
. A ___ is a diagram that graphically depicts the steps that take place in a program. a. flowchart b. step chart c. code graph d. program graph
a. flowchart
. Which built-in function can be used to read input that has been typed on the keyboard? a. input(). b. get_input() c. read input() d. keyboard ()
a. input().
In the expression 12 + 7, the values on the right and left of the + symbol are called a. operands b. operators c. arguments d. math expressions
a. operands
A ___ is a name that references a value in the computer's memory a. variable b. register c. RAM slot d. byte
a. variable
Which of the following statements will cause an error? a. X = 17 b. 17 = x c.X = 99999 d. x = '17'
b. 17 = x
. A magic number is ___. a. a number that is mathematically undefined b. an unexplained value that appears in a program's code c. a number that cannot be divided by 1 d. a number that causes computers to crash
b. an unexplained value that appears in a program's code
A(n) ___ makes a variable reference a value in the computer's memory. a. variable declaration b. assignment statement c. math expression d. string literal
b. assignment statement
Suppose the following statement is in a program: price = 99.0. After this statement executes, the price variable will reference a value of which data type? a. int b. float c. currency d. str
b. float
Which built-in function can be used to convert an int value to a float? a. int_to_float(). b. float() c. convert() d. int()
b. float()
A ___ is a name that represents a value that does not change during the program's execution. a. named literal b. named constant c. variable signature d. key term
b. named consta