Chapter 9 Dictionaries and Sets - College of William & Mary
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
- stats 507 data analysis in python university of michigan
- data types in python
- chapter 9 dictionaries and sets college of william mary
- lecture 14 nested lists tuples and dictionaries
- intermediate python data structures
- programming principles in python csci 503
- python beginner tutorials python tutorials python tutorial
- helix core p4python developer guide
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