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
Cite 6 user type data structures in python3
stacks,
queues,
trees,
linked lists,
graphs,
hashmaps.
Last in first out (LIFO) describe what user type data structure?
stacks
linear data-structure, reversing words, recursion programming, word editors,
First in first out (FIFO) describe what user type data structure?
queues
about: linear data structure, array structured, heads & tails, traffic congestion management, dequeue, enque to remove elements, job scheduling (ie print que)
A non linear data structure ecompassing a root and nodes is what type of user defined data structure?
trees
about: parent child relationships, last node are described as leaves, hierarchy structured (ie web pages), efficient at searching
A linear data structure that isn’t sorted and utilizes pointers describes what user defined data structure?
linked list
about: image viewing, pointers -> next, used in music player applications,
What user defined data structure encompasses pointers, vertices and edges
graphs
about: real world example of a map, used by Google map, used to determine quickest most efficient routes between nodes or points, used by Uber.
What user defined data structure can define a dictionary like structure much like a phone book?
hashmaps
about: identical as a dict object in python, used in applications like phone books,
populate data from a list,
_________ are rules or instructions that are formulated in a finite, sequential order to colve problems. They provide the ________ for problems.
algorithms
pseudocode
What are the 5 steps involved in writing algorithms?
- determine the exact problem
- define start
- define stop
- formulate intermediate steps
- review


