Top "Tuples" questions

In programming, tuples are simple *product types*, representing ordered collections of types.

How to extract the n-th elements from a list of tuples?

I'm trying to obtain the n-th elements from a list of tuples. I have something like: elements = [(1,1,1),(2,3,7),(3,5,10)] I wish to …

python list tuples
Python : List of dict, if exists increment a dict value, if not append a new dict

I would like do something like that. list_of_urls = ['http://www.google.fr/', 'http://www.google.fr/', …

python loops list tuples
Python: Tuples/dictionaries as keys, select, sort

Suppose I have quantities of fruits of different colors, e.g., 24 blue bananas, 12 green apples, 0 blue strawberries and so on. …

python select dictionary key tuples
Unpacking a list / tuple of pairs into two lists / tuples

Possible Duplicate: A Transpose/Unzip Function in Python I have a list that looks like this: list = (('1','a'),(…

python list tuples
Better naming in Tuple classes than "Item1", "Item2"

Is there a way to use a Tuple class, but supply the names of the items in it? For example: …

c# c#-4.0 tuples
Accessing a value in a tuple that is in a list

[(1,2), (2,3), (4,5), (3,4), (6,7), (6,7), (3,8)] How do I return the 2nd value from each tuple inside this list? Desired output: [2, 3, 5, 4, 7, 7, 8]

python list tuples
Python element-wise tuple operations like sum

Is there anyway to get tuple operations in Python to work like this: >>> a = (1,2,3) >>> …

python tuples
Why is there no tuple comprehension in Python?

As we all know, there's list comprehension, like [i for i in [1, 2, 3, 4]] and there is dictionary comprehension, like {i:j …

python tuples list-comprehension dictionary-comprehension set-comprehension
What and When to use Tuple?

May someone please explain what a Tuple is and how to use it in a Real World Scenario. I would …

c# .net c#-4.0 .net-4.0 tuples
JavaScript variable assignments from tuples

In other languages like Python 2 and Python 3, you can define and assign values to a tuple variable, and retrieve their …

javascript tuples destructuring