Next / Previous / Contents / TCC Help System / NM Tech homepage

7.4. The tuple type

A tuple, like a list, represents a sequence of zero or more objects of any type. Unlike mutable lists, though, tuples cannot be modified in place; that is, they are immutable.

To create a tuple, place zero or more values between parentheses with commas between them. If there is only one value, place a comma after it. The examples shown below are tuples containing four, one, and zero values respectively:

("red", 255, 0, 0)
(10,)
()

All the operations described in intrinsics for sequences apply to tuples.

When to use tuples: