June 2017
Beginner to intermediate
274 pages
6h 49m
English
The next data structure we'll look at is the tuple. A tuple expression is any sequence of value expressions separated by commas if it happens in the place where the language wasn't already expecting to see a comma.
However, it's common and smart to put parentheses around most tuple expressions because it avoids ambiguity. The code example for tuple is as follows:

Like a list, data values can be retrieved from a tuple using numbers. However, we can't add more data to a tuple, and we cannot replace one data value with another.
Why would we want a data structure like that?
Well, there are several reasons. We can list them as follows:
Read now
Unlock full access