Loops Quiz

By Mickey Arnold
Last updated 10 months ago
5 Questions

What is the output?
x = 0
for r in range( 3, 10 ):
x = x + r
print( x )

What is the output?

i = 0
while i < 21:
i += 5
print(i)

What is the output? You can type in the box.

m = 0
word = "school"
for let in word:
if m % 2 == 0:
print(let)
m += 1

What is the output?

words = "computer programming"
b = 0
for let in words:
if let == "m":
b = b + 2
else:
b = b + 1
print(b)

What is the output?You can type in the box.

x = 4
while x > 0:
y = 2
while y > 0:
print("#", end = " ")
y -= 1
x -= 1
print()