wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Banana Tales Quiz

Total questions: 16

Worksheet time: 8mins

Name
Class
Date
1.

Which coding concept is introduced in Lesson 1?

a)

Functions

b)

Variables

c)

Objects

d)

Loops

2.

What is the purpose of the 'print()' function?

a)

To define a function

b)

To store data

c)

To display output on the console

d)

To create a variable

3.

In Python, what does the 'len()' function do?

a)

Returns the number of items in a list

b)

Counts the number of characters in a string

c)

Calculates the length of a variable

d)

Prints the length of a number

4.

What is the correct syntax for a for loop in Python?

a)

for i in 10

b)

for i in range(10):

c)

for (i = 0; i < 10; i++)

d)

for i: range(10)

5.

What does the 'while' loop do?

a)

Executes code only once

b)

Creates a new variable

c)

Repeats code a fixed number of times

d)

Repeats code as long as a condition is true

6.

What does the 'is_ice()' method check?

a)

If an object is a box

b)

If an object is ice

c)

If an object is on the ground

d)

If an object is a fence

7.

What does the 'if' statement do?

a)

Defines a function

b)

Executes code only if a condition is false

c)

Always executes the code

d)

Executes code only if a condition is true

8.

What is the purpose of the 'for' loop?

a)

To repeat code a specific number of times

b)

To execute code only once

c)

To create a new variable

d)

To define a function

9.

What is the output of the following code: print(len([1, 2, 3]))?

a)

3

b)

2

c)

1

d)

Error

10.

What does the 'is_on_ground()' method check?

a)

If an object is ice

b)

If an object is a box

c)

If an object is a fence

d)

If an object is on the ground

11.

What is the correct syntax for an if statement?

a)

if (condition)

b)

if condition:

c)

if condition

d)

if: condition

12.

What does the 'not' operator do?

a)

Reverses the result of a condition

b)

Combines two conditions

c)

Checks if a condition is true

d)

Checks if a condition is false

13.

What is the output of the following code: print(3 == 3)?

a)

3

b)

False

c)

True

d)

Error

14.

What is the output of the following code: print(4 > 5)?

a)

Error

b)

4

c)

False

d)

True

15.

What is the output of the following code: print(5 != 5)?

a)

Error

b)

True

c)

False

d)

5

16.

What is the purpose of the 'elif' statement?

a)

To create a loop

b)

To check another condition in an if statement

c)

To exit a loop

d)

To define a function