On the meaning and usage of tuples in Python
I dig the word “tuple”. It sounds like a word you should know but can’t quite place. It makes me think about tipple, as in tippling wine at the gallery opening. That, in turn, reminds me of the Monty Python sketch called “Stock Exchange Report,” in which a reporter broadcasts, “Ting tang tong rankled dithely, little tipples pooped and poppy things went pong!”
In Python world, a tuple is also like a grouping, consisting of a number of values separated by commas and contained inside parentheses. Here’s an example of a tuple:
pokerFriends = ("Joe", "Shiho", "Jose")
Go ahead and type that into your IDLE shell and hit enter. Now, If you type the word “pokerFriends” into the Shell, it should spit out the tuple:
('Joe', 'Shiho', 'Jose')
So, now you have a tuple (which is a grouping, of course) that is called pokerFriends. The names, which are separated by commas, are the values. We could (and will) go deeper into these matters, but let’s quit for now. Just remember that you tipple wine and tuple values.
Featured image: Dionne quintuplets, 1937, unknown author: https://commons.wikimedia.org/wiki/File:The-dionne-quintuplets_1937.jpg