Chapter 7. What's in Your Backpack?
In Chapter 6, Working with Data – Lists and Dictionaries, we explored how to store, retrieve, and change data using lists and dictionaries in Python. In this chapter, we will build a two player game called What's in Your Backpack? This game will require us to review all of the skills we have learned since the beginning of this book. We use our skills to make loops, ask for information from the user with the raw_input()
function, and then store this information in lists or dictionaries.
Be prepared to also learn some new skills that might seem complicated. We will try something called nesting or putting one thing inside another. With nesting lists and dictionaries, we have more flexible data storage. Using this new nesting skill with the other skills we have learned, we will create a game that can be played by two users or adjusted to be played by many users.