
S4: RECAP UNTIL TESTING
Authored by Kieran Kyle
Computers
11th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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.
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
14 questions
ITGS - IT Systems (Hardware)
Quiz
•
10th - 12th Grade
13 questions
ICT and Retail Industry
Quiz
•
8th - 12th Grade
10 questions
Sains Komputer Tingkatan 4 - 3.1.1 Mengkaji keperluan intera
Quiz
•
1st Grade - Professio...
10 questions
Python with DataScience
Quiz
•
7th Grade - University
10 questions
Podstawy Pythona
Quiz
•
9th - 12th Grade
10 questions
หน่วยที่ 1 ความรู้เบื้องต้นเกี่ยวกับเครื่องพิมพ์ดีด
Quiz
•
9th - 12th Grade
10 questions
IT Quiz
Quiz
•
11th - 12th Grade
16 questions
OCR Sys Arch J277
Quiz
•
10th - 12th Grade
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
21 questions
Presidents Day Trivia
Quiz
•
6th - 12th Grade
10 questions
Valentine's Day: History and Modern Celebration
Interactive video
•
9th - 12th Grade
11 questions
Valentine's Day Trivia
Quiz
•
8th - 12th Grade
10 questions
Factor Quadratic Expressions with Various Coefficients
Quiz
•
9th - 12th Grade
10 questions
Evaluating Piecewise Functions Practice
Quiz
•
11th Grade
18 questions
Success Strategies
Quiz
•
9th - 12th Grade