Test #2 review
Which type of loop causes a statement or set of statements to repeat a specific number of times?
For
What is the process of inspecting data that has been input to the program, to make sure it is valid before it is used known as?
Input validation
In Python, what character is used to indicate a code block associated with an if statement?
Tab
In Python, logical operators and and or perform short-circuit evaluation.
True
Which of the following is NOT one of Python's built-in data types?
decimal
What built-in Python function is used to get data from the end user?
input()
What built-in Python function is used to change the background color?
.bgcolor()
What built-in Python function is used to have the turtle write text to the graphics screen?
.write()
a * b^2 / q Which of the following is an equivalent Python statement for the above equation?
print((a*b**2)/q)
What built-in Python function is used to draw a circle?
.circle()
What built-in Python function returns True if the turtle is visible, or False otherwise?
.isvisible()
What built-in Python function reports the current turtle graphics pen color?
.pencolor()
What built-in Python function is used to change the pen size?
.pensize()
Which number is passed as an argument to Python's turtle graphics .speed() function to make it go as fast as possible?
10
Which Python operator determines whether two values are equal?
==
Which of the following is NOT one of Python's variable naming rules?
A variable name must be as short as possible.
What is a variable that is used to accumulate the total of the numbers known as?
Accumulator
What is used to create a variable and make it reference a piece of data?
Assignment statement
Which of the following type of operators allows the abstract concepts of true and false to be used in computations?
Boolean operators
In Python, what is the default initial heading of the turtle?
East
What are 2 other names for input validation loops?
Error handler Error trap
Python does not provide any mechanism to break any long statement into multiple lines.
False
What is the truth table value using the and operator for the expression "true and false"?
False
What are Boolean variables commonly used as? (e.g. signals when some condition exists in the program)
Flag variable
What statement is used to create a decision structure, which allows a program to have more than one path of execution?
If
What is an unexplained value that appears in a program's code known as?
Magic number
What is a loop that is inside another loop called?
Nested loop
In Python, what character is used to indicate a comment?
Octothorpe(#)
Place the following math operations into their proper order.
Parentheses Exponent Division Subtraction
In Python, the while loop is what type of loop, meaning it tests its condition before performing an iteration?
Pretest
In Python, a Boolean variable can reference one of what two values?
True / False
What is a name that represents a value stored in the computer's memory known as?
Variable
Which type of loop causes a statement or set of statements to repeat as long as a condition is true?
While
In Python, what operator is used to perform exponent operations?
base ** exponent
In Python, which of the following is the correct conditional test to determine if a grade is a 'C' letter grade?
if (grade >= 70) and (grade < 80):
What built-in Python function is used to convert numeric string data passed as an argument to a value of an integer data type?
int()
In Python, which of the following is NOT one of the built-in logical operators?
maybe
Which argument of the format() function allows us to specify separator characters?
sep=
What type of control structure causes a statement or set of statements to execute repeatedly?
Repetition
In Python, if and else statements are examples of what type of control structure?
Selection
What is a special value that marks the end of a sequence of items known as?
Sentinel
In Python, you may use what two characters to enclose a string literal?
Single quote