Tuples, like arrays, are ordered collections of scalar values, but the elements don't have to be the same type.
In fact, tuple elements can be values of any type including arrays and other tuples:
Tuple elements can be accessed by specifying an index after a
This works for nested tuples too:
Tuples can also give names to their elements. In that case the tuple elements can be accessed by either name or index:
Naming elements can make nested tuples quite readable:
You can also use casts to change the type of the elements inside tuples by using a "nested" cast notation: