Python Test 2

Python Test 2

8th Grade

20 Qs

quiz-placeholder

Similar activities

El Computador

El Computador

5th - 11th Grade

20 Qs

Y10M2A2 - Selection

Y10M2A2 - Selection

6th - 10th Grade

15 Qs

TIK VII YT, GC, VIDCOF

TIK VII YT, GC, VIDCOF

7th - 12th Grade

20 Qs

Kiến thức về Thuật toán và Chương trình

Kiến thức về Thuật toán và Chương trình

8th Grade - University

20 Qs

8-klass Informatika 2021

8-klass Informatika 2021

8th Grade

15 Qs

Python Recap

Python Recap

7th Grade - University

20 Qs

CPA Revision MCQ1

CPA Revision MCQ1

8th - 9th Grade

20 Qs

Arduino

Arduino

7th - 9th Grade

15 Qs

Python Test 2

Python Test 2

Assessment

Quiz

Computers

8th Grade

Practice Problem

Hard

Created by

Quốc Thư

Used 14+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers