Quiz 3 - Computational Thinking
T/F: In Python, = means equals, whereas == means assignment
False
T/F: The not operator has a lower precedence than the and and or operators
False
T/F: The or operator returns True if an only if both of its operands are true, and returns False otherwise
False
T/F: The comparison operators are applied after addition but before assignment
True
T/F: The if-else statement is the most common type of selection statement
True
T/F: When the step argument is a negative number, the range function generates a sequence of numbers from the first argument down to the second argument plus 1
True
Inside of a loop, after a termination condition has been met, what statement can be used to cause an exit from the loop and execute the remainder of the script?
break
What is a count controlled loop?
loop that counts through a range of numbers to control when the loop ends
In evaluating a loop, you find the following statement: "value += 1". What happens to the value variable upon each iteration of the loop?
variable is increased by 1 each iteration through the loop
Given the following statement: "%4d" % var1, which of the following is accurate?
variable var1 must be an integer