Python Set

Python Set

University

40 Qs

quiz-placeholder

Similar activities

TERCER EXAMEN PARCIAL GINECOOBSTETRICIA LE-UDLAP

TERCER EXAMEN PARCIAL GINECOOBSTETRICIA LE-UDLAP

University

41 Qs

Bài Thi ĐỐ EM KHỐI 12 - Vòng  loại

Bài Thi ĐỐ EM KHỐI 12 - Vòng loại

12th Grade - University

40 Qs

PPKN

PPKN

1st Grade - University

45 Qs

UTS Jiwa 1_3ABC_Rabu, 27 Okt,21

UTS Jiwa 1_3ABC_Rabu, 27 Okt,21

University

40 Qs

CHP 3 & CHP 4: COST & PRODUCTION, MARKET STRUCTURE

CHP 3 & CHP 4: COST & PRODUCTION, MARKET STRUCTURE

University

42 Qs

LearnTube  Digital Marketing Quiz 17/3/23

LearnTube Digital Marketing Quiz 17/3/23

University

36 Qs

IPAS-IKLIM 3

IPAS-IKLIM 3

4th Grade - University

45 Qs

UJIAN MID BOGA DASAR

UJIAN MID BOGA DASAR

10th Grade - University

40 Qs

Python Set

Python Set

Assessment

Quiz

Other

University

Hard

Created by

Gokul Chinnathurai

Used 103+ times

FREE Resource

AI

Enhance your content in a minute

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

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these about a set is not true?

Mutable data type

Allows duplicate values

Data type with unordered values

Immutable data type

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not the correct syntax for creating a set?

set([[1,2],[3,4]])

set([1,2,2,3,4])

set((1,2,3,4))

{1,2,3,4}

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

nums = set([1,1,2,3,3,3,4,4])

print(len(nums))

7

Error, invalid syntax for formation of set

4

8

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

a = [5,5,6,7,7,7]

b = set(a)

def test(lst):

if lst in b:

return 1

else:

return 0

for i in filter(test, a):

print(i,end=" ")

5 5 6

5 6 7

5 5 6 7 7 7

5 6 7 7 7

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is used to create an empty set?

{ }

set()

[ ]

( )

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

>>> a={5,4}

>>> b={1,2,4,5}

>>> a<b

{1,2}

True

False

Invalid operation

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If a={5,6,7,8}, which of the following statements is false?

print(len(a))

print(min(a))

a.remove(5)

a[2]=45

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?