IT 116: Introduction to Scripting
Answers to Class 5 Ungraded Quiz
-
What is the result of the following calculation in Python's interactive mode?
7 / 2
3.5
-
What is the result of the following calculation in Python's interactive mode?
7 // 2
3
-
What is the result of the following calculation in Python's interactive mode?
7 % 2
1
-
What is the result of the following calculation in Python's interactive mode?
7 ** 2
49
-
What is the result of the following calculation in Python's interactive mode?
2 + 3 * 5
17
-
What is the result of the following calculation in Python's interactive mode?
(2 + 3) * 5
25
-
What arithmetic operators have the highest precedence (parentheses
are NOT operators)?
**
-
What arithmetic operators have the next highest precedence?
*, /, //, %
-
What arithmetic operators have the next lowest precedence?
+, -
-
What would you type at the end of a line if you wanted to continue a Python
statement to the next line?
\ (backslash)