
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
M3 R5 ( Chapter 3)

Quiz
•
Professional Development
55 questions
Linux Test Prep 2

Quiz
•
8th Grade - Professio...
50 questions
CCNA Day 4

Quiz
•
Professional Development
50 questions
GT-ECOPS CCNA Day1 Set2

Quiz
•
Professional Development
50 questions
Security+ Authentication Design Concepts

Quiz
•
Professional Development
50 questions
DBMS Quiz

Quiz
•
Professional Development
45 questions
CORSAIR TRIVIA NIGHT 3

Quiz
•
Professional Development
47 questions
Getting Started with Docker and Dockerfile

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade