wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

For loop

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

what will this display?/ Экранға қандай жауап шығады?

a)

0,1,2,3,4,5

b)

0,1,2,3,4

c)

1,2,3,4,5

d)

Error

2.

For i in range(5):

print('Happy Python') Мына код орындалғанда 'Happy Python' сөзі неше рет экранға шығады?

a)

4

b)

5

c)

6

3.

What are the syntax errors in this code?/ Қандай синтаксистік қате бар?

a)

:

b)

Not indented

c)

Both options

4.

What is the variable in this for loop. /Мына for циклының есептегішін/айнымалысы/ көрсетіңіз.

a)

x

b)

(6)

c)

for

d)

range

5.

This loop can only be used when the programmer knows the number of times a code is to be repeated/ Бұл циклды программист оның қанша рет қайталанатынын білген кезде қолданады.

a)

while

b)

for

c)

do while

d)

repeat until

6.

What is a loop? Цикл дегеніміз не?

a)

A condition

b)

A set of intructions that are repeated until a certain condition is met

c)

A set of rules

7.

To repeat a fixed number of times use a / Алдын ала белгілі қайталану санын қолданатын цикл

a)

while loop

b)

for loop

c)

if loop

d)

indentation

8.

What would be the starting value in the FOR LOOP code?/FOR циклі кодында бастапқы мән қандай болады?

a)

100

b)

10

c)

5

d)

20

9.

s=0

for i in range(1,5,2):

s=s+i

print(s)

What would be the ending value in the FOR LOOP code?/ FOR циклі орындалған соң шығатын мән қандай болады?

a)

15

b)

1

c)

10

d)

100

10.

In a Python program, how many iterations(loops) will occur for the FOR LOOP code? / Python бағдарламасында FOR цикл коды үшін қанша итерация (цикл) болады?

a)

1

b)

10

c)

9

d)

8