stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Data Structures in Python Flashcards | StudBud
Explore
/
Data Structures in Python
Data Structures in Python
10 terms
·
StudBud Administration
·
21 plays
Imported from external platform
Flashcards
10 cards
F
Practice quiz
P
Host live
L
Questions
10
Answers
1
Which of the following is an example of a list in Python?
(1,2,3)
“1,2,3”
[1, 2, 3]
{1,2,3}
2
What is the main characteristic of a dictionary in Python?
It only stores numbers.
It stores data in a single line.
It stores data in pairs of keys and values.
It cannot be changed once created.
3
In Python, you may store objects of different types in the same list.
False
True
4
What is the main purpose of using a list in Python?
To store a collection of related or unrelated values.
To create a simple program.
To perform mathematical calculations.
To store a single value.
5
If set1 = {1, 2, 3} and set2 = {2, 3, 4}, what is the result of set1 | set2?
{1, 4}
{2, 3}
{1}
{1, 2, 3, 4}
6
What is the purpose of using a set in Python?
To perform complex mathematical operations.
To create a simple game.
To store a collection of unique values.
To store a single, large number.
7
If set1 = {1, 2, 3} and set2 = {2, 3, 4}, what is the result of set1 & set2?
{1}
{2, 3}
{1, 2, 3, 4}
{1, 4}
8
What will the following code output?
[2,3]
3
4
It’s an invalid index.
9
How do you create an empty dictionary in Python?
my_dict = {}
None of the above
my_dict = []
my_dict = ()
10
What is the Python operator for finding the union of two sets (i.e., all unique elements from both sets)?
|
&
-
^