Python Built-In Data Structures Flashcards
Python has 4 types of built-in data structures, they are?
lists,
tuples,
dictionaries,
sets.
Which two types of python data structures are mutatable?
lists and dictionaries.
What python data types are not mutable?
tuples and sets.
Python lists are created by?
[]
Python sets are created by?
{ }
Python dictionary are created by?
{ }
dict( )
Python tuples are created by?
( )
Cite the data structure?
a = [“apple”, “banana”, “cherry”]
print(a)
list
Cite the data structure?
a = (“apple”, “banana”, “cherry”)
tuple
Cite the data structure?
a = {“apple”, “banana”, “cherry”}
set
Cite the data structure?
a = {
“brand”: “Ford”,
“model”: “Mustang”,
“year”: 1964
}
dictionary
______ items are ordered, changeable, and allow duplicate values.
______ items are indexed, the first item has index [0], the second item has index [1] etc.
List
List
____ items are ordered, unchangeable, and allow duplicate values.
____ items are indexed, the first item has index [0], the second item has index [1] etc.
tuple
tuple
____ items are unordered, unchangeable, and do not allow duplicate values.
set
_____ items are unordered, changeable, and does not allow duplicates.
_____ items are presented in key:value pairs, and can be referred to by using the key name.
dictionary