Jan-10-2021, 01:42 AM
(Jan-10-2021, 12:54 AM)matt_the_hall Wrote: As for tuples, my understanding is that a tuple is a fixed size (2) list.
Tuples are similar to lists (they're sequences, fixed length, etc.) The main difference is that lists can be changed after creation and tuples cannot. If you want a slightly different tuple, you have to copy the data into a new, immutable object. For someone reading the information from a tuple rather than creating them, there's almost no difference and you can treat them as a special kind of list.
The name comes from the common part of higher named multiples. Like you might say quintuple or sextuple, "n-tuple" or "tuple" is just a generalization of a sequence with n elements.