Welcome to Besides Blocks: Data Structures in Python

In this lab we will explore data structures in Python. Right now you might be saying: "Hold on. What's a data structure?" This concept isn't discussed much in Snap! because there is only one data structure: the list. You can think of a data structure as an object that can hold data. In Snap! lists can hold pretty much anything: numbers, strings, booleans, functions, and even other lists (all of these things can be data).


Python lists are almost exactly the same as lists in Snap! However, in Python we also have other useful data structures, such as the dictionary, which will be discussed later on in this lab (a dictionary can be thought of as a more powerful list).


The goal of this second Python lab is to get you familiar with working with data structures in Python. This means that you'll not only be creating lists and dictionaries, but you'll also learn about some useful functions that Python provides for operating on these data structures, enabling you to easily solve problems involving data.