wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Banana Tales - CodeMonkey

Total questions: 37

Worksheet time: 30mins

Name
Class
Date
1.

What is variable in banana tales?

a)

is a place in the computer's memory for storing some kind of data

b)

is a bottle to store kind of drinks

c)

is a name for a beautiful lady

2.

What kind of data can't be stored in variable?

a)

a number

b)

a text string

c)

a full stop

3.

Which statement is NOT related to a variable?

a)

whale[0].blow(6)

b)

goal = snake[2].length

c)

for snake in snakes

4.

How to define a variable in banana tales by giving name final and value of 6?

a)

final = 6

b)

6 = final

c)

final : 6

5.

What is the outcome for the statement shown as above?

a)
b)
c)
6.

How to define a slice in Banana Tales?

a)

for snake in snakes[4:8]:

b)

for snake in snakes(4:8):

c)

for snake in snakes{4:8}:

7.

statement A : for snake in range(2,8):

statement B : for snake in snakes[2:8]:

a)

statement A is kind of range

statement B is kind of slice

b)

statement A is kind of slice

statement B is kind of range

c)

statement A is kind of range

statement B is kind of range

8.

Which outcome is best for print len("Teacher Tan")..?

a)
b)
c)
9.

Which giraffe's height will become 10..?

a)

giraffes[2], giraffes[4], giraffes[6], giraffes[8]

b)

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

c)

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

10.

Read carefully with the statement stated, which diagram is the correct outcome produced?

a)
b)
c)
11.

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

12.

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

13.

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]

14.

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

a)

[0]

b)

[0, 1]

c)

[ ]

15.

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

a)

[ ]

b)

[5, 6, 7, 8]

c)

[8, 7, 6, 5]

16.

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]

17.

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]

18.

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

a)

6

b)

monkey

c)

[6]

19.

Which of the following is the correct syntax to print the value of a variable named score using the print() function in Python?

a)

print(score)

b)

print(score())

c)

print("score")

d)

print('score')

20.

What do we use print() function for?

a)

To execute a specific line of code.

b)

To display the output of a program to the user.

c)

To define a function in Python.

d)

To declare a variable in Python.

21.

Which of the following is correct about lists in Python?

a)

A list is a named collection of items.

b)

The items have order and are indexed.

c)

These items are accessed by using square brackets [ ].

d)

All of the above.

22.

How can you determine the number of items in a list?

a)

Using the len() function

b)

Using the size() method

c)

Using the length() method

d)

Using the count() method

23.

What is the index of the last item in a list?

a)

0

b)

1

c)

The number of items in the list.

d)

The number of items in the list minus 1.

24.

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?

a)

whales[2].blow(10)

b)

whales[1].blow(10)

c)

whales[0].blow(10)

d)

whales[3].blow(10)

25.

What is the purpose of a for loop?

a)

To perform a single action on an item in a list.

b)

To iterate over each item in a list and perform the same action.

c)

To create a new list from an existing one.

d)

To remove items from a list.

26.

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?

a)

fruit

b)

fruits

c)

apple

d)

banana

27.

What is the purpose of the range() function in Python?

a)

To determine the length of a list.

b)

To specify the start and stop values for a loop.

c)

To create a list of numbers.

d)

To generate a random number.

28.

The game world is represented on the right and the area for writing code is on the left in Banana Tales 1 interface.

a)

True

b)

False

29.

A collection of code and data intended to represent something is called as __________.

a)

Property

b)

Object

c)

Data

d)

Codes

30.

In the code "giraffe.height = 3", height is called as ______

a)

giraffe height

b)

giraffe length

c)

object

d)

property

31.

Object and property in a code is always divided by a _____

a)

dot

b)

full stop

c)

comma

d)

exclamation

32.

Which of the operator means less than equal to ?

a)

>

b)

<

c)

>=

d)

<=

33.

What symbol do you use to make or add a comment in Python?

a)

@

b)

¬

c)

;

d)

#

34.

7. What does == mean?

a)

a. Assignment operator

b)

b. Boolean operator

c)

c. Comparison operator

d)

d. Arithmetic operator

35.

Which animal is NOT found in Banana Tales?

a)

Zebra

b)

Giraffe

c)

Snake

36.

Which property is found in Banana Tales?

a)

height

b)

giraffe

c)

blow

37.

How to define a method in Banana Tales?

a)

whale.blow

b)

giraffe.height

c)

x = 20