Python Collections

Treehouse
Course Summary
We can get pretty far in Python with numbers, strings, lists, booleans, and basic logic. Eventually, though, we're going to need more complex containers for our data. We're also going to need more control over lists and strings. In Python Collections, I'll teach you about dictionaries, sets, tuples, slices, and how to exert even more control over lists in your Python programs!
-
+
Course Description
About this Course We can get pretty far in Python with numbers, strings, lists, booleans, and basic logic. Eventually, though, we're going to need more complex containers for our data. We're also going to need more control over lists and strings. In Python Collections, I'll teach you about dictionaries, sets, tuples, slices, and how to exert even more control over lists in your Python programs! What you'll learn
- Lists
- Dictionaries
- Tuples
- Sets
- Variable packing and unpacking
About the Teacher
Besides teaching Python at Treehouse, Kenneth Love is a husband & father. He created a few popular Python libraries, worked at most levels of the web stack, & was the Creative Director of a newspaper. He likes board games, whiskey, activism, & dry humor.
-
+
Course Syllabus
Lists
Lists are an old friend to anyone that's done even a little Python. They have a lot to offer us, though, so let's explore their methods and uses a bit further. 10 steps- Let's Review Lists 1:37
- Creating lists 1 objective
- Growing Lists 6:04
- Combining Lists 3 objectives
- Shopping List Take Three 10:11
- List creation/extension methods 6 questions
- Removing Items From A List 5:57
- Disemvowel 1 objective
- Pop 6:53
- Removing items from a list 2 objectives
- Extra Credit Take our shopping list script even further if you want. Some suggestions:
- Make it possible to move items from one position to another
- Change the formatting of the list display
- Create a CLEAR command that removes everything from the list
Slices
We don't always want the entirety of a list or string. Sometimes we just want part of it, and Python calls these sub-string or sub-lists "slices" 8 stepsDictionaries
Unlike their hard-backed namesakes, Python's dictionaries are easy to create, update, and take advantage of. 9 stepsTuples
Quite possibly the most common data type (behind the scenes, at least) in all of Python, tuples, which act like immutable lists, are a great tool for every Pythonista. 7 stepsSets
Not as common of data type, sets are, nevertheless, crucial for certain parts of Python development. 6 stepsDungeon Game
With all of your new Python tools, I think it's time to build another game together. 9 steps