wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Banana Tales Part 1 - For loop & Range

Total questions: 18

Worksheet time: 18mins

Name
Class
Date
1.

What is for loop in python language..?

a)

use to repeat the code one time for each element in the list

b)

use to execute every function one by one

c)

use to turn or curve a shape in movement

2.

What will happened if running this algorithm, for whale in whales : ..?

a)

whale will represent different object that is part of the whales list

b)

whale will spout the water immediately

c)

whale will joining the other group of whales

3.

How to define a loop for bananas..?

a)

for banana in bananas:

b)

for banana in bananas

c)

for banana in bananas;

4.

Which statements is suitable for the scenario stated..?

a)
b)
c)
5.

Which scenario is correct for the statements stated above..?

a)
b)
c)
6.

What is range( ) for..?

a)

used to create lists of numbers

b)

a kind brand of vehicle named Range Rover

c)

to calculate a specific of numbers

7.

How to define a range..?

a)

range( )

b)

range[ ]

c)

range{ }

8.

If print range(5), what will displayed on screen?

a)

[0, 1, 2, 3, 4]

b)

[1, 2, 3, 4, 5]

c)

[5]

9.

What is the first argument used for..?

a)

is the integer to start at

b)

is one less than the final number

c)

is used to skip over numbers that stated

10.

What is the second argument used for..?

a)

is the integer to start at

b)

is one less than the final number

c)

is used to skip over numbers that stated

11.

What is the third argument used for..?

a)

is the integer to start at

b)

is one less than the final number

c)

is used to skip over numbers that stated

12.

What list is produced by the statement range(3, 8)..?

a)

[3, 4, 5, 6, 7]

b)

[4, 5, 6, 7, 8]

c)

[1, 2, 3, 4, 5, 6, 7, 8]

13.

What list is produced by the statement range(0, 1)..?

a)

[0]

b)

[0, 1]

c)

[ ]

14.

What list is produced by the statement range(9, 5)..?

a)

[ ]

b)

[5, 6, 7, 8]

c)

[8, 7, 6, 5]

15.

What list is produced by the statement range(2, 9, 3)..?

a)

[2, 5, 8]

b)

[2, 4, 6, 8]

c)

[2, 3, 4, 5, 6, 7, 8]

16.

What list is produced by the statement range(10, 100, 20)..?

a)

[10, 30, 50, 70, 90]

b)

[1, 3, 5, 7, 9]

c)

[10, 20, 30, 40, 50, 60, 70, 80, 90]

17.

What list is produced by the statement range(-9, -2, 3)..?

a)

[-9, -6, -3]

b)

[-3, -6, -9]

c)

[-2, -5, -8]

18.

What list is produced by the statement print len("monkey")..?

a)

6

b)

monkey

c)

[6]