PythonTupeDicSet

PythonTupeDicSet

1st - 3rd Grade

17 Qs

quiz-placeholder

Similar activities

HTML quiz

HTML quiz

1st Grade

19 Qs

Bimtek Fasda PMP

Bimtek Fasda PMP

1st Grade

20 Qs

Weird Stuff

Weird Stuff

KG - University

15 Qs

O5A Level 3 day 1

O5A Level 3 day 1

1st - 3rd Grade

15 Qs

Estructura de la Lengua

Estructura de la Lengua

1st Grade - University

15 Qs

How much idea I have?

How much idea I have?

1st Grade - Professional Development

20 Qs

Cortadoras y Dobladoras de Varilla

Cortadoras y Dobladoras de Varilla

2nd Grade

13 Qs

JFPAP BPK RI - ANALISIS PROSES BISNIS

JFPAP BPK RI - ANALISIS PROSES BISNIS

1st Grade

20 Qs

PythonTupeDicSet

PythonTupeDicSet

Assessment

Quiz

Professional Development

1st - 3rd Grade

Practice Problem

Hard

Created by

Viết Phan

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

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

17 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Select all which is true for Python set

Sets are unordered

set object does support indexing

set doesn’t allow duplicate

sets are written with curly brackets {}

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following set operation

set1 = {"Yellow", "Orange", "Black"}

set2 = {"Orange", "Blue", "Pink"}

set3 = set2.difference(set1)

print(set3)

{‘Yellow’, 'Black', ‘Pink’, ‘Blue’}

{‘Pink’, ‘Blue’}

{‘Yellow’, 'Black'}

{‘Yellow’, ‘Blue’}

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following set operation

{‘Yellow’, ‘Orange’, ‘Black’, [“Blue”, “Green”, “Red”]}

TypeError: update() doesn’t allow list as a argument.

[‘Yellow’, ‘Orange’, ‘Red’, ‘Black’, ‘Green’, ‘Blue’]

{‘Yellow’, ‘Orange’, ‘Red’, ‘Black’, ‘Green’, ‘Blue’}

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following

sampleSet = {"Yellow", "Orange", "Black"}

sampleSet.add("Blue")

sampleSet.add("Orange")

print(sampleSet)

{‘Blue’, ‘Orange’, ‘Yellow’, ‘Orange’, ‘Black’}

{"Yellow", "Orange", "Black","Blue", "Orange"}

{‘Blue’, ‘Orange’, ‘Yellow’, ‘Black’}

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What is the output of the following code

Yellow

Orange

Syntax Error

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What is the output of the following

KeyError: ‘Blue’

TypeError

{‘Yellow’, ‘Orange’, ‘Black’}

[‘Yellow’, ‘Orange’, ‘Black’]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following code

TypeError

{‘PYnative’, 1, (‘abc’, ‘xyz’), True}

{‘PYnative’, 1, ‘abc’, ‘xyz’, True}

{‘PYnative’, 1, (‘abc’, ‘xyz’)}

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?