Each of the following questions is worth 4 points.
a statement
an argument
anything that can be turned into a value
literals, variables, calculations, function calls
7 // 2
3
True and False
not False
True
True and False
False
True or False
True
not True
False
while
loop when the boolean expression after the keyword
while
becomes false?
the loop stops
-=
a local variable
parameters
from the corresponding argument in the function call
if signal == "green":
print("Go")
elif signal == "yellow":
print("Slow")
elif signal == "red":
print("Stop")
else:
print("Error")
while
loop that asks the user for a number
greater than 10. num = int(input("Number greater than 10: "))
while num <= 10:
print(num, "is not greater than 10")
num = int(input("Number greater than 10: "))
print(num)
for
loop that prints the even numbers from 2
to 10 using the range
function.
for num in range(2,11,2):
print(num)
for
loop with the
range
function.
def print_cubes(min, max):
for n in range(min, max +1):
print(n * n * n