2 Chapter 2: Introduction to Python Programming
© Copyright 2020 by Pearson Education, Inc. All Rights Reserved.
Answer: c. Actually, Python is case sensitive, so number and Number are dif-
ferent identifiers because one begins with a lowercase letter and the other
begins with an uppercase letter.
2.2 Q4: The value 10.5 is a(n) _______ (that is, a number with a decimal point).
a. integer
b. string
c. floating-point number
d. None of the above
2.3 Arithmetic
2.3 Q1: Which of the following statements a), b) or c) is false?
a. Python uses the asterisk (*) as the multiplication operator (e.g., 7 * 4).
b. The exponentiation (**) operator raises one value to the power of another (e.g.,
2 ** 10).
c. To square a number, you can use the exponent 1/2 (that is, 0.5), as in:
9 ** (1 / 2)
d. All of the above statements are true.
2.3 Q2: Which of the following statements is false?
a. True division (/) divides a numerator by a denominator and yields a floating-
point number with a decimal point.
b. Floor division (//) divides a numerator by a denominator, yielding the highest
integer that’s not greater than the result.
c. The expression –13 / 4 evaluates to –3.25.
d. The expression –13 // 4 evaluates to -3.
2.3 Q3: Which of the following statements is false?
a. Dividing by zero with / or // is not allowed and results in an exception—an
indication that a problem occurred.
b. Python reports an exception with a traceback.
c. Most exception names end with Exception.
d. In IPython interactive mode, the line that begins with —-> shows the code
that caused the exception.