NEW
Font size
Worksheetsمراجعة في الجملة التكرارية for
Total questions: 10
Worksheet time: 5mins
what is the output
for x in range(3):print("Hello")
Hello
Hello
Hello
Hello
Hello
Hello
what is the output
for x in range(2,10,3):print("Hello")
Hello
Hello
Hello
Hello
Hello
Hello
what is the output
for x in range(2,3):print("Hello")
Hello
Hello
Hello
Hello
Hello
Hello
what is the output
listii=[1,2,3,4]
for x in listii :print("Hello")
Hello
Hello
Hello
Hello
1
2
3
4
[1,2,3,4]
what is the output
listii=[1,2,3,4]
for x in listii :print(x)
Hello
Hello
Hello
Hello
1
2
3
4
[1,2,3,4]
what is the output
listii=[1,2,3,4]
for x in listii :print(x+1)
2
3
4
5
1
2
3
4
[1,2,3,4]
what is the output
Name="Mohamed"
for x in Name :print(x)
M
o
h
a
m
e
d
Mohamed
Mohamed
Mohamed
Mohamed
Mohamed
Mohamed
Mohamed
what is the output
Name="Mohamed"
for x in Name :
print(x+"od")
Mod
hod
aod
mod
eod
dod
M
h
a
m
e
d
Mohamed
what is the output
fruit=["berry","cherry","Mango"]
count=0
for x in fruit :
if x[-1]=="y": count+=1
print(count,"times the fruit ended with letter y")
One, times the fruit ended with letter y
2 times the fruit ended with letter y
2
what is the output
fruit=["berry","cherry","Mango"]
count=0
for x in fruit :
if len(x)>5: count+=1
print(count)
5
2
1
