Twa kɔ nsɛm atitiriw so
Log in
Sign up for FREE
arrow_back
Laabri

Python Loops Work Sheet

star
star
star
star
star
Last updated over 2 years ago
5 Nsɛmmisa
1
Asemmisa {{asɛmmisaAhyɛnsode}}
1.

What is the output of code below?

for i in range(5):

print(i, end = " ")

1
Asemmisa {{asɛmmisaAhyɛnsode}}
2.

What is the output of code below?

for x in range(3):

print("time", end = " ")

1
1
1
Asemmisa {{asɛmmisaAhyɛnsode}}
3.

What is the output of code below?

j = 0

while j < 10:

j += 3

print(j)

Asemmisa {{asɛmmisaAhyɛnsode}}
4.

What is the output of code below?

word = "september"

for let in word:

if let != "m":

print(let, end = " ")

else:

break

Asemmisa {{asɛmmisaAhyɛnsode}}
5.

What is the output of code below? Use show your work box to show output.

x = 3

while x > 0:

y = 3

while y > 0:

print("-", end = " ")

y -= 1

x -= 1

print()