Section 4 overview
So far your programs have worked with one value at a time. Real programs handle collections — a list of users, a row of scores, a queue of tasks.
In this section you'll learn to store many values in a single variable and process them one by one, without writing the same line over and over.
What you'll cover
- Lists — store an ordered collection of values and reach any one of them by its position
forloops — run the same block of code once for every item in a listrange()— generate sequences of numbers to loop a fixed number of timeswhileloops — repeat code as long as a condition stays true- Totals and counters — the accumulator pattern for adding things up and counting them
By the end of this section
You'll be able to take a list of data and total it, count it, transform it, or print it — the everyday work of almost every program you'll ever write.
Click Next to get started.
No comments yet. Add the first comment to start the discussion.