Each of the following questions is worth 4 points.
7 ** 2
49
2 + 3 * 5
17
True and False
True and False
False
True or False
True
an infinite loop
Control C
while
loop when the boolean expression
after the keyword while
becomes false?
the loop stops
while
loop with the following header ever stop?
while True:
no
for
loop get its values?
from the list of values after in
*=
a local variable
no
parameters
from the corresponding argument in the function call
if score >= 90:
print("A")
elif score >= 80:
print("B")
elif score >= 70:
print("C")
elif score >= 60:
print("D")
else:
print("F")
while
loop that prints the numbers 5, 10, 15,
each on a separate line. while
loop.
num = 5
while num < 15:
print(num)
num += 5
for
loop that prints the odd numbers from 3
to 11. range
function
with 3 arguments. for num in range(3, 12, 2):
print(num)
def is_divisible_by_seven(num):
if num % 7 == 0:
print("True")
else:
print('False')