
Python test 3
Authored by Quốc Thư
Computers
8th Grade
Used 11+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
x = 10
if x > 5:
........x = x + 1
elif x == 10:
........x = x + 2
else:
........x = x + 3
print(x)
11
12
13
10
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the code below?
def calculate(a, b):
........if a > b:
................return a - b
........else:
................return b - a
x = calculate(5, 10)
print(x)
5
-5
0
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output?
lst = [2, 3, 4]
for i in range(len(lst)):
........lst[i] += 1
print(lst)
[2, 3, 4]
[3, 4, 5]
[2, 4, 6]
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output?
n = 5
fact = 1
while n > 0:
.........fact *= n
.........n -= 1
print(fact)
120
24
60
0
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following function return? def mystery(x):
.........return x * x - 2 * x + 1
print(mystery(4))
9
4
1
16
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result?
inner outer
outer inner
inner inner
outer outer
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which output is correct?
numbers = [1, 2, 3, 4, 5]
result = list(map(lambda x: x * x, numbers))
print(result)
[2, 4, 6, 8, 10]
[1, 4, 9, 16, 25]
[1, 2, 3, 4, 5]
Error
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
19 questions
Computer Networks - Year 7
Quiz
•
7th - 8th Grade
22 questions
Steve Jobs
Quiz
•
6th - 12th Grade
21 questions
HTML5 & CSS3 Refresher
Quiz
•
7th - 12th Grade
20 questions
Productivity Programs
Quiz
•
6th - 8th Grade
16 questions
Programming and Logic Lesson 2
Quiz
•
6th - 8th Grade
20 questions
Technology Innovations
Quiz
•
5th - 12th Grade
16 questions
Python programming
Quiz
•
6th - 12th Grade
17 questions
Plotting Shapes on Code.Org
Quiz
•
5th - 8th Grade
Popular Resources on Wayground
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
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade