NEW
Font size
WorksheetsBanana Tales Part 1 - For loop & Range
Total questions: 18
Worksheet time: 18mins
What is for loop in python language..?
use to repeat the code one time for each element in the list
use to execute every function one by one
use to turn or curve a shape in movement
What will happened if running this algorithm, for whale in whales : ..?
whale will represent different object that is part of the whales list
whale will spout the water immediately
whale will joining the other group of whales
How to define a loop for bananas..?
for banana in bananas:
for banana in bananas
for banana in bananas;
Which statements is suitable for the scenario stated..?
Which scenario is correct for the statements stated above..?
What is range( ) for..?
used to create lists of numbers
a kind brand of vehicle named Range Rover
to calculate a specific of numbers
How to define a range..?
range( )
range[ ]
range{ }
If print range(5), what will displayed on screen?
[0, 1, 2, 3, 4]
[1, 2, 3, 4, 5]
[5]
What is the first argument used for..?
is the integer to start at
is one less than the final number
is used to skip over numbers that stated
What is the second argument used for..?
is the integer to start at
is one less than the final number
is used to skip over numbers that stated
What is the third argument used for..?
is the integer to start at
is one less than the final number
is used to skip over numbers that stated
What list is produced by the statement range(3, 8)..?
[3, 4, 5, 6, 7]
[4, 5, 6, 7, 8]
[1, 2, 3, 4, 5, 6, 7, 8]
What list is produced by the statement range(0, 1)..?
[0]
[0, 1]
[ ]
What list is produced by the statement range(9, 5)..?
[ ]
[5, 6, 7, 8]
[8, 7, 6, 5]
What list is produced by the statement range(2, 9, 3)..?
[2, 5, 8]
[2, 4, 6, 8]
[2, 3, 4, 5, 6, 7, 8]
What list is produced by the statement range(10, 100, 20)..?
[10, 30, 50, 70, 90]
[1, 3, 5, 7, 9]
[10, 20, 30, 40, 50, 60, 70, 80, 90]
What list is produced by the statement range(-9, -2, 3)..?
[-9, -6, -3]
[-3, -6, -9]
[-2, -5, -8]
What list is produced by the statement print len("monkey")..?
6
monkey
[6]
