Quiz 3 - Computational Thinking

Ace your homework & exams now with Quizwiz!

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


Related study sets

Principles of Strength Training #3

View Set

FIN 3100 - determinants of interest rates

View Set

Health Class Final Exam study set

View Set

Test 3: diabetes quizzes, extra studying

View Set

Renewable Energy System Midterm 2

View Set

Social Studies Chapter 18 Section 3 Questions - The Reconstruction South

View Set

PrepUs- Chapter 40 - Fluid, Electrolyte and Acid-Base Balance

View Set