Quiz Competition

Quiz Competition

University

30 Qs

quiz-placeholder

Similar activities

IMAN KEPADA KITAB

IMAN KEPADA KITAB

7th Grade - University

25 Qs

PKWU Budidaya Ikan Konsumsi

PKWU Budidaya Ikan Konsumsi

12th Grade - University

25 Qs

Prelim Exam

Prelim Exam

University

25 Qs

Introduction to IC Engine

Introduction to IC Engine

University

25 Qs

Soal Pawarta Thp

Soal Pawarta Thp

11th Grade - Professional Development

25 Qs

Studytime 6/2

Studytime 6/2

12th Grade - University

25 Qs

Викторина "Великая отечественная война"

Викторина "Великая отечественная война"

University

25 Qs

UAS Metodologi Penelitian

UAS Metodologi Penelitian

University

25 Qs

Quiz Competition

Quiz Competition

Assessment

Quiz

Education

University

Practice Problem

Hard

Created by

S. Aarthi

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

1. What will be the output of the following code?

[1], [2], [3], [4]

[1], [1, 2], [3], [1, 2, 4]

[1], [1, 2], [3], [1, 2, 3, 4]

[1], [1, 2], [3], [3, 4]

Answer explanation

The default argument lst=[] is mutable. It retains its state between function calls unless explicitly overridden.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

2. What will be the output?

[1, 2, 3]

Error

[1, 2, 3, [4, 5]]

[1, 2, 3, 4, 5]

Answer explanation

Since y = x, both variables point to the same list. The += operation modifies the existing list, so x also gets updated.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

3. What is the output of this code?

[1], [2], [3]

[1], [2, 3], [1, 3]

[1], [2], [1, 3]

[1], [2], [1, 2, 3]

Answer explanation

Similar to Question 1, the default mutable list retains its state across function calls.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

4. What will be the output?

True

False

None

Error

Answer explanation

Any non-empty string in Python is truthy, regardless of its content.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

5. What is the result of this expression?

True

False

None

Error

Answer explanation

Due to floating-point precision errors, 0.1 + 0.2 is not exactly 0.3, but rather 0.30000000000000004.

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

6. What does this return?

[1, 2, 3, 4, 5]

{1, 2, 2, 3, 4, 4, 5}

Error

{1, 2, 3, 4, 5}

Answer explanation

A set only stores unique elements.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

7. Which of the following is immutable in Python?

List

Tuple

Dictionary

Set

Answer explanation

Lists, dictionaries, and sets are mutable, while tuples are immutable.

Access all questions and much more by creating a free account

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?