CIT 486 Final Exam
1. Which of the following statements is false?
The following if statement uses the == comparison operator to determine
whether the values of variables number1 and number2 are equal:
if number1 == number2:print(number1, 'is equal to', number2)
Each if statement consists of the keyword if, the condition to test, and a colon
(:) followed by an indented body called a suite.
Each suite contains zero or more statements.
,Forgetting the colon (:) after the condition is a common syntax error.: Each suite
contains zero or more statements.
2. Which of the following statements is false?
The following assignment statement adds the values of variables x and y and
assigns the result to the variable total:
total = x + y
The preceding snippet is read, "total is assigned the value of x + y."
The = symbol is the assignment operator.
The right side of the = symbol always executes first, then the result is assigned
,to the variable on the symbol's left side.: The = symbol is the assignment operator.
3. Which of the following statements is incorrect:
min(17, 19, 23, 29, 31, 37, 43) is a valid call to built-in function min,
The range of values is simply the minimum through the maximum value.
Much of data science is devoted to getting to know your data.
All of the above are correct.: All of the above are correct.
4. When using IPython in interactive mode to evaluate a simple arithmetic
expression in a new session, which of the following is false?
, The text "In [1]:" is a prompt, indicating that IPython is waiting for your input.
You can type ? for help or you can begin entering snippets
After you type an expression like 45 + 72 and press Enter, IPython reads the
snippet, evaluates it and prints its result in Out[1]:.
Then IPython displays the In [2] prompt to show that it's waiting for you to enter
your second snippet
Python uses x for multiplication and the forward slash (/) for division.: Python uses
x for multiplication and the forward slash (/) for division.
1. Which of the following statements is false?
The following if statement uses the == comparison operator to determine
whether the values of variables number1 and number2 are equal:
if number1 == number2:print(number1, 'is equal to', number2)
Each if statement consists of the keyword if, the condition to test, and a colon
(:) followed by an indented body called a suite.
Each suite contains zero or more statements.
,Forgetting the colon (:) after the condition is a common syntax error.: Each suite
contains zero or more statements.
2. Which of the following statements is false?
The following assignment statement adds the values of variables x and y and
assigns the result to the variable total:
total = x + y
The preceding snippet is read, "total is assigned the value of x + y."
The = symbol is the assignment operator.
The right side of the = symbol always executes first, then the result is assigned
,to the variable on the symbol's left side.: The = symbol is the assignment operator.
3. Which of the following statements is incorrect:
min(17, 19, 23, 29, 31, 37, 43) is a valid call to built-in function min,
The range of values is simply the minimum through the maximum value.
Much of data science is devoted to getting to know your data.
All of the above are correct.: All of the above are correct.
4. When using IPython in interactive mode to evaluate a simple arithmetic
expression in a new session, which of the following is false?
, The text "In [1]:" is a prompt, indicating that IPython is waiting for your input.
You can type ? for help or you can begin entering snippets
After you type an expression like 45 + 72 and press Enter, IPython reads the
snippet, evaluates it and prints its result in Out[1]:.
Then IPython displays the In [2] prompt to show that it's waiting for you to enter
your second snippet
Python uses x for multiplication and the forward slash (/) for division.: Python uses
x for multiplication and the forward slash (/) for division.