Academy
1/6
Python for data, the basics

Lesson 3 of 5 · 8 min

Lists and loops

A list holds many values in order, inside square brackets. Here is a year of monthly rainfall in millimetres for a weather station. The numbers are made up, but shaped like an Abuja year: dry at the start and end, with the heaviest rain in August and September.

rain = [0, 6, 24, 84, 162, 186, 228, 270, 252, 132, 12, 0]
List
An ordered collection of values in square brackets, like [0, 6, 24].
Saved to your glossary
or press Enter