Overview
By the end of this chapter, you will be able to write succinct, readable expressions for creating lists; use Python comprehensions with lists, dictionaries, and sets; use collections.defaultdict
to avoid exceptions when using dictionaries; write iterators to enable Pythonic access to your data types; explain how generator functions are related to iterators and write them to defer complex calculations; use the itertools
module to succinctly express complex sequences of data; and use the re
module to work with regular expressions in Python.