You are on page 1of 4

Python

Arrays
Arrays
An array is a variable that stores a collection of things, like a list. For
example a list of peoples names.
We can access the different values stored in an array using an index.
Index 0 1 2 3
Value Alex James Patrick Andy
If this array was
called names
we could access
this value using:
names[1]
How would we
access this
value?
Example Program
How could we make this program more efficient?
Example Program
For loops and Arrays go well together, each time the For loop cycles
round it can access a different position in the array.

You might also like