Challenge 3-1: Arrays

Challenge 3-1: Arrays

A Collection of Objects

Now it's time for a new word, and one you may well not have come across before - arrays.

But what is an array? Don't let the unfamiliar name fool you, because arrays are actually really common. Basically, an array is any collection of things.

Say you had a big collection of toys, and you want to keep track of them all. You could make a list (remember that word for later) of every toy's name, and that would be an example of an array. Or, you could count up how many toys of each brand you have, and put that information into a dictionary (remember that word too). That's an array as well! Or, if you laid out all your toys neatly in an order, that would also be an array.

Usually, in programming, we use the word array to mean a collection of data. That's a little bit more specific than the definition we used above, because computers usually can't store things, only data about those things.

Now, we'll introduce you to two special types of arrays we can use in Python: lists and dictionaries (told you!)