
S4: RECAP UNTIL TESTING
Quiz
•
Computers
•
11th Grade
•
Medium

Kieran Kyle
Used 1+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
x = 10
if x > 5:
print("Greater")
else:
print("Smaller")
Greater
Smaller
Error
No Output
Answer explanation
The if statement checks if x is greater than 5. Since x is 10, the condition is True, and "Greater" is printed.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the final value of sum after this code is executed?
num = 0
for i in range(5):
num = num + i
print(num)
5
10
15
20
Answer explanation
The loop iterates over a range of 5 numbers from 0 to 4. The sum of these numbers (0+1+2+3+4) is 10
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the list my_list = ["apple", "banana", "cherry"]
What does print(len(my_list)) return?
3
6
15
Error
Answer explanation
The len() function returns the number of items in an object. Since my_list contains three items, the result is 3.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be printed by the following code snippet?
fruits = ["apple", "banana", "cherry"]
print(fruits[1])
apple
banana
cherry
IndexError
Answer explanation
Arrays in Python are zero-indexed, so fruits[1] refers to the second element in the list, which is "banana".
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code do?
user_input = 0
while user_input < 1 or user_input > 10:
user_input = int(input("Enter a number between 1 and 10: "))
Repeats until a number less than 1 is entered.
Repeats until a number greater than 10 is entered.
Repeats until a number between 1 and 10 is entered.
Causes an infinite loop.
Answer explanation
The code keeps asking for input until the user enters a number within the range 1-10 (inclusive).
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How does the following code snippet calculate a running total?
numbers = [1, 2, 3, 4, 5]
total = 0
for index in numbers:
total = total + index
Adds the index of each element to total.
Adds the value of each element to total.
Multiplies the value of each element with total.
Subtracts the value of each element from total.
Answer explanation
The code iterates through the list numbers and adds each to the total variable, accumulating the sum of the list elements.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What kind of error will occur when the following code is executed?
for i in range(10)
print(i)
Syntax
Logic
Execution
Extreme
Answer explanation
The code is missing a colon : at the end of the for loop declaration, which is required in Python to indicate the start of the loop's body. This will result in a syntax error when the code is run.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple

Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
2025
Quiz
•
11th Grade
14 questions
9.1.5 - Starter Quiz
Quiz
•
7th - 11th Grade
15 questions
python basics
Quiz
•
11th Grade - University
8 questions
Повторение март ОГЭ
Quiz
•
9th - 12th Grade
11 questions
J277 Programming - Data Types
Quiz
•
9th - 11th Grade
10 questions
Python Boolean and If
Quiz
•
9th - 12th Grade
10 questions
Python
Quiz
•
1st - 12th Grade
10 questions
Quiz 16 - Arrays and Loops
Quiz
•
11th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade