
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
16 questions
Conditions
Quiz
•
8th - 10th Grade
17 questions
Đề ôn tập cuối HKI lớp 5
Quiz
•
6th Grade - University
20 questions
ÔN TẬP WHILE DO VÀ FOR TO DO
Quiz
•
8th Grade
15 questions
Bluetooth and Wi-Fi Quiz
Quiz
•
7th Grade - University
20 questions
MS EXCEL
Quiz
•
8th - 10th Grade
20 questions
Yr 8.1 Spreadsheet/Excel Models
Quiz
•
6th - 8th Grade
20 questions
Ficha sumativa 8º (Investigar e Pesquisar)
Quiz
•
8th Grade
20 questions
Rješavanje problema i programiranje
Quiz
•
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