O'Reilly logo

Learn to Program with Scratch by Majed Marji

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Lists

The programs we’ve written so far have used ordinary variables to store single pieces of data. Such variables are not as useful, however, when you want to store a bunch of values, such as your friends’ phone numbers, names of books, or a month of temperature readings.

For example, if you wanted your program to remember the phone numbers of 20 of your friends, you’d need 20 variables! Certainly, writing and maintaining a program with 20 variables would be tedious. In this chapter, we’ll explore another built-in data type, called a list, which offers a convenient way to group related values. Here’s what we’ll cover:

  • How to create and manipulate lists

  • Initializing and accessing individual elements in a list

  • Basic sorting and search techniques ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required