November 2017
Beginner to intermediate
204 pages
5h 23m
English
An array is an ordered collection of values. Each item in an array is called an element. In Python, there can be an indefinite number of elements in an array. Python has a special name for its implementation of arrays, called a list. With regard to Python, I will use both words to refer to the same thing.
The following syntax can be used to create an array:
<arrayName>=[<element1>,<element2>,<element3>,...]
Inside square brackets, each element in the array is listed, separated by commas:
>> myArray = ["foo","bar","sup?","yo!"]>> print(myArray)
The elements of an array can be accessed by their relative position, or index, in the array. To access an element of an array, you can use the following syntax:
>> ...
Read now
Unlock full access