Chapter 17
Collections
Learning Objectives
- Understand how to work with and manipulate strings
- Syntax for creating new lists
- Work with strings and lists using bracket notation, iteration, and common list methods
- Create and use Python dictionaries
- Create and use Python tuples
- Recognize the benefits and drawbacks of dictionaries vs. lists vs. tuples
Key Terminology
Strings
Strings as Collections
- character
- collection data type
- ordered collections
- length function
- empty string
Bracket Notation
- index
- bracket notation
- substring
- slice
Lists
List Basics
- list
- elements
Working with Lists
- mutable
Cloning Lists
- aliased
- cloning
Lists within Lists
- multi-dimensional list
- nested list
Dictionaries
Dictionary Basics
- dictionary
- key/value pairs