Select all which is true for Python set
PythonTupeDicSet

Quiz
•
Professional Development
•
1st - 3rd Grade
•
Hard
Viết Phan
Used 3+ times
FREE Resource
17 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
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
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
What is the output of the following code
Yellow
Orange
Syntax Error
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the output of the following
KeyError: ‘Blue’
TypeError
{‘Yellow’, ‘Orange’, ‘Black’}
[‘Yellow’, ‘Orange’, ‘Black’]
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
Similar Resources on Wayground
12 questions
DBMS QUIZ 2

Quiz
•
1st - 12th Grade
15 questions
QA Questions

Quiz
•
3rd Grade
15 questions
Django #1 (basic)

Quiz
•
1st Grade - Professio...
15 questions
Disney Trivia

Quiz
•
KG - Professional Dev...
20 questions
Pengenalan Kaizen

Quiz
•
1st Grade
15 questions
Service orange

Quiz
•
1st - 3rd Grade
20 questions
BIG STAR 1 GAME

Quiz
•
2nd - 12th Grade
15 questions
Programming - Screening Test

Quiz
•
3rd Grade - Professio...
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade