
Python Sets and Dictionaries Quiz

Quiz
•
Computers
•
Professional Development
•
Medium
ankush joshi
Used 29+ times
FREE Resource
50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax to create a set in Python?
set = {1, 2, 3}
set = [1, 2, 3]
set = (1, 2, 3)
set = <1, 2, 3>
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not allowed in a set?
Integer
String
List
Tuple
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Sets in Python are:
Ordered
Mutable
Immutable
Duplicated
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of: len({1, 2, 2, 3})?
2
3
4
5
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you add an element to a set s?
s.append(x)
s.add(x)
s.insert(x)
s.extend(x)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following removes all elements from a set?
s.remove()
s.clear()
del s[]
s.popall()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The method discard() in sets:
Removes the element and throws an error if not found
Removes the element without error if not found
Adds a new element
Sorts the set
Create a free account and access millions of resources
Similar Resources on Wayground
50 questions
May test sscsa

Quiz
•
Professional Development
45 questions
Android ATC_Practice 4

Quiz
•
Professional Development
50 questions
TGF2

Quiz
•
Professional Development
45 questions
MySql Basics

Quiz
•
Professional Development
50 questions
Python Basic 101

Quiz
•
Professional Development
55 questions
WP 11-15

Quiz
•
Professional Development
50 questions
Test Mendix 4

Quiz
•
Professional Development
55 questions
Microsoft Azure Fundamentals AZ-900 ENG #4

Quiz
•
University - Professi...
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade