Skip to Content
Getting Started with Processing.py
book

Getting Started with Processing.py

by Allison Parrish, Ben Fry, Casey Reas
May 2016
Beginner content levelBeginner
242 pages
4h 19m
English
Make: Community
Content preview from Getting Started with Processing.py

Chapter 11. Lists

list is a group of variables that share a common name. Lists are useful because they make it possible to work with more variables without creating a new name for each one. This makes the code shorter, easier to read, and more convenient to update.

From Variables to Lists

When a program needs to keep track of one or two things, it’s not necessary to use a list. In fact, adding a list might make the program more complicated than necessary. However, when a program has many elements (for example, a field of stars in a space game or multiple data points in a visualization), lists make the code easier to write.

Example 11-1: Many Variables

To see what we mean, refer to Example 8-3. This code works fine if we’re moving around ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Introduction to D3.js with React

Introduction to D3.js with React

Adam Janes

Publisher Resources

ISBN: 9781457186820Errata Page