Chapter 9 Dictionaries and Sets
chapter 9
Dictionaries and Sets
More Data Structures
? we have seen the list data structure and
what it can be used for
? we will now examine two more advanced
data structures, the set and the dictionary
? in particular, the dictionary is an important,
very useful part of Python, as well as
generally useful to solve many problems
2
"The Practice of Computing Using Python, 3rd Edition",
Punch & Enbody, Copyright ? 2017 Pearson Education, Inc.
Dictionaries
3
"The Practice of Computing Using Python, 3rd Edition",
Punch & Enbody, Copyright ? 2017 Pearson Education, Inc.
What is a Dictionary?
? in data structure terms, a dictionary is
better termed an associative array,
associative list or a map
? you can think if it as a list of pairs, where
the first element of the pair, the key, is
used to retrieve the second element, the
value
? thus, we map a key to a value
4
"The Practice of Computing Using Python, 3rd Edition",
Punch & Enbody, Copyright ? 2017 Pearson Education, Inc.
Key/Value Pairs
? the key acts as an index to find the
associated value
? just like a dictionary, you look up a word
by its spelling to find the associated
definition
? a dictionary can be searched to locate the
value associated with a key
5
"The Practice of Computing Using Python, 3rd Edition",
Punch & Enbody, Copyright ? 2017 Pearson Education, Inc.
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- lecture 8 hashing i mit opencourseware
- 10 python dictionary
- chapter 9 dictionaries and sets
- python dicts and sets inspiring innovation
- declaring a dictionary in python
- cs303e elements of computers and programming
- introduction to scientific computing with
- python dicts and sets dict sparse array
- chapter 2 lists arrays and dictionaries
- 1 2 https 21pre9
Related searches
- developmental psych chapter 9 quizlet
- chapter 9 cellular respiration test
- chapter 9 psychology test answers
- chapter 9 tom sawyer summary
- chapter 9 1 cellular respiration
- chapter 9 cellular respiration key
- chapter 9 cellular respiration answers
- chapter 9 cellular respiration answer key
- chapter 9 lifespan development quiz
- chapter 9 cellular respiration ppt
- mark chapter 9 verse 23
- mark chapter 9 niv