NEW
Font size
WorksheetsBanana Tales - CodeMonkey
Total questions: 37
Worksheet time: 30mins
What is variable in banana tales?
is a place in the computer's memory for storing some kind of data
is a bottle to store kind of drinks
is a name for a beautiful lady
What kind of data can't be stored in variable?
a number
a text string
a full stop
Which statement is NOT related to a variable?
whale[0].blow(6)
goal = snake[2].length
for snake in snakes
How to define a variable in banana tales by giving name final and value of 6?
final = 6
6 = final
final : 6
What is the outcome for the statement shown as above?
How to define a slice in Banana Tales?
for snake in snakes[4:8]:
for snake in snakes(4:8):
for snake in snakes{4:8}:
statement A : for snake in range(2,8):
statement B : for snake in snakes[2:8]:
statement A is kind of range
statement B is kind of slice
statement A is kind of slice
statement B is kind of range
statement A is kind of range
statement B is kind of range
Which outcome is best for print len("Teacher Tan")..?
Which giraffe's height will become 10..?
giraffes[2], giraffes[4], giraffes[6], giraffes[8]
giraffes[2], giraffes[3], giraffes[4], giraffes[5], giraffes[6], giraffes[7], giraffes[8]
giraffes[0], giraffes[1], giraffes[2], giraffes[3], giraffes[4], giraffes[5], giraffes[6], giraffes[7], giraffes[8]
Read carefully with the statement stated, which diagram is the correct outcome produced?
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 print len("monkey")..?
6
monkey
[6]
Which of the following is the correct syntax to print the value of a variable named score using the print() function in Python?
print(score)
print(score())
print("score")
print('score')
What do we use print() function for?
To execute a specific line of code.
To display the output of a program to the user.
To define a function in Python.
To declare a variable in Python.
Which of the following is correct about lists in Python?
A list is a named collection of items.
The items have order and are indexed.
These items are accessed by using square brackets [ ].
All of the above.
How can you determine the number of items in a list?
Using the len() function
Using the size() method
Using the length() method
Using the count() method
What is the index of the last item in a list?
0
1
The number of items in the list.
The number of items in the list minus 1.
In Banana Tales Part I, if we have a list named whales and we want the second whale to blow water to a height of 10, which of the following statements correctly represents the code to achieve this?
whales[2].blow(10)
whales[1].blow(10)
whales[0].blow(10)
whales[3].blow(10)
What is the purpose of a for loop?
To perform a single action on an item in a list.
To iterate over each item in a list and perform the same action.
To create a new list from an existing one.
To remove items from a list.
In Banana Tales Part I, if we have a list named fruits containing ['apple', 'banana', 'orange'], what is the loop variable in the code snippet beside?
fruit
fruits
apple
banana
What is the purpose of the range() function in Python?
To determine the length of a list.
To specify the start and stop values for a loop.
To create a list of numbers.
To generate a random number.
The game world is represented on the right and the area for writing code is on the left in Banana Tales 1 interface.
True
False
A collection of code and data intended to represent something is called as __________.
Property
Object
Data
Codes
In the code "giraffe.height = 3", height is called as ______
giraffe height
giraffe length
object
property
Object and property in a code is always divided by a _____
dot
full stop
comma
exclamation
Which of the operator means less than equal to ?
>
<
>=
<=
What symbol do you use to make or add a comment in Python?
@
¬
;
#
7. What does == mean?
a. Assignment operator
b. Boolean operator
c. Comparison operator
d. Arithmetic operator
Which animal is NOT found in Banana Tales?
Zebra
Giraffe
Snake
Which property is found in Banana Tales?
height
giraffe
blow
How to define a method in Banana Tales?
whale.blow
giraffe.height
x = 20
