
Python Test 2

Quiz
•
Computers
•
8th Grade
•
Hard
Quốc Thư
Used 7+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
x = 5
x = x == 5
print(x + 2)
7
2
True2
3
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code snippet. What will be the final value of x?
x = 0
for i in range(1, 4):
.........for j in range(i):
..................x += i + j
print(x)
18
21
24
27
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code print?
def func(x, y=[]):
.........y.append(x)
.........return y
print(func(1))
print(func(2))
[1][2]
[1, 2][1, 2]
[1][1, 2]
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be printed after executing this code?
x = [1, 2, 3]
y = x
x += [4, 5]
print(x)
print(y)
[1, 2, 3, 4, 5] and [1, 2, 3, 4, 5]
[1, 2, 3, 4, 5] and [1, 2, 3]
[1, 2, 3] and [4, 5]
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following expression?
print(1 < 2 < 3 == True)
True
False
Error
None
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is printed by the following code?
x = 10
x += x - x // x + x * 0
print(x)
A. 19
B. 9
C. 10
D. Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output?
def foo(x):
.........return x if x % 2 == 0 else x + 1
print(foo(foo(3)))
3
4
5
6
Create a free account and access millions of resources
Similar Resources on Wayground
19 questions
Final Lesson

Quiz
•
6th - 8th Grade
15 questions
Scratch Programming

Quiz
•
5th - 9th Grade
15 questions
Python цикли

Quiz
•
8th Grade
15 questions
Python basics

Quiz
•
6th - 8th Grade
15 questions
Python. Ввод и вывод данных. Операции с числами, строками

Quiz
•
8th Grade
15 questions
Milestone Exkul SMP SMA - Q5_2022_Basic Python Syntax

Quiz
•
6th - 8th Grade
19 questions
Programming Techniques Survey

Quiz
•
8th - 12th Grade
22 questions
Python 11

Quiz
•
8th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
15 questions
Acceptable Use Policy (Quiz)

Quiz
•
6th - 8th Grade
25 questions
Career Vs. Job

Quiz
•
6th - 8th Grade
15 questions
Computer Components Video

Interactive video
•
8th Grade
10 questions
Networking Devices and Their Functions

Interactive video
•
5th - 8th Grade
20 questions
Binary Numbers Quiz

Quiz
•
6th - 8th Grade