Scalars

Closely related to scalars are arrays and tuples. These types are ordered collections of scalar values that are treated as a single value themselves.

Arrays are homogeneous collections, meaning that all of the elements have to be of the same type:

Input

Array elements can be accessed by giving an index (starting with 0) enclosed in [...]:

Input

Tuples are heterogeneous collections, meaning that tuple elements can be of any type (that includes arrays and tuples as well):

Input

Tuples elements can be accessed by specifying an index after a .:

Input

Tuples can also give names to their elements. In that case the tuple elements can be accessed by either name or index:

Input
Input
Input