Python Data Structures Quiz Form
Test your knowledge of Python data structures with this quiz. Please answer all questions.
Which of the following is a mutable data structure in Python?
*
List
Tuple
String
Integer
Select all built-in collection types in Python.
*
List
Dictionary
Set
Stack
What is the output of the following code? my_list = [1, 2, 3] print(my_list[1])
*
Which method adds an item to the end of a list in Python?
*
append()
add()
insert()
extend()
Which of the following statements correctly creates a set in Python?
*
my_set = {1, 2, 3}
my_set = [1, 2, 3]
my_set = (1, 2, 3)
my_set = dict(1, 2, 3)
Fill in the blank: A Python __________ is an unordered collection of unique elements.
*
Which data structure would you use for key-value pairs?
*
Dictionary
List
Tuple
Set
How confident are you in your answers to this quiz?
1
2
3
4
5
Which of the following is NOT a valid operation on a tuple?
*
append()
count()
index()
len()
Briefly explain the difference between a list and a tuple in Python.
*
Submit Quiz
Should be Empty: