Indexing

Arrays provide a handy method, len(), which tells you how many items they contain. They also support an indexing operator. An array has a sequence of values, numbered 0, 1, 2, and up. Each of these numbers is known as the index. The indexing operator takes the index and gives you the value at its position. Note that, since indices start at 0, an array of size 5 would have indices 0, 1, 2, 3, and 4, but does not have index 5.

This program will print out all of the values in the array: