NEW
Font size
WorksheetsBanana Tales Quiz
Total questions: 16
Worksheet time: 8mins
Which coding concept is introduced in Lesson 1?
Functions
Variables
Objects
Loops
What is the purpose of the 'print()' function?
To define a function
To store data
To display output on the console
To create a variable
In Python, what does the 'len()' function do?
Returns the number of items in a list
Counts the number of characters in a string
Calculates the length of a variable
Prints the length of a number
What is the correct syntax for a for loop in Python?
for i in 10
for i in range(10):
for (i = 0; i < 10; i++)
for i: range(10)
What does the 'while' loop do?
Executes code only once
Creates a new variable
Repeats code a fixed number of times
Repeats code as long as a condition is true
What does the 'is_ice()' method check?
If an object is a box
If an object is ice
If an object is on the ground
If an object is a fence
What does the 'if' statement do?
Defines a function
Executes code only if a condition is false
Always executes the code
Executes code only if a condition is true
What is the purpose of the 'for' loop?
To repeat code a specific number of times
To execute code only once
To create a new variable
To define a function
What is the output of the following code: print(len([1, 2, 3]))?
3
2
1
Error
What does the 'is_on_ground()' method check?
If an object is ice
If an object is a box
If an object is a fence
If an object is on the ground
What is the correct syntax for an if statement?
if (condition)
if condition:
if condition
if: condition
What does the 'not' operator do?
Reverses the result of a condition
Combines two conditions
Checks if a condition is true
Checks if a condition is false
What is the output of the following code: print(3 == 3)?
3
False
True
Error
What is the output of the following code: print(4 > 5)?
Error
4
False
True
What is the output of the following code: print(5 != 5)?
Error
True
False
5
What is the purpose of the 'elif' statement?
To create a loop
To check another condition in an if statement
To exit a loop
To define a function
