About 17,200,000 results
Open links in new tab
  1. What's the difference between lists and tuples? - Stack Overflow

    Mar 9, 2009 · What are the differences between lists and tuples, and what are their respective advantages and disadvantages?

  2. python - What is a tuple useful for? - Stack Overflow

    Sep 9, 2014 · 1 A tuple is useful for storing multiple values.. As you note a tuple is just like a list that is immutable - e.g. once created you cannot add/remove/swap elements. One benefit of …

  3. How does tuple comparison work in Python? - Stack Overflow

    Tuples are compared position by position: the first item of the first tuple is compared to the first item of the second tuple; if they are not equal (i.e. the first is greater or smaller than the …

  4. python - Convert numpy array to tuple - Stack Overflow

    Apr 5, 2012 · Is there an easy way to convert that to a tuple? I know that I could just loop through, creating a new tuple, but would prefer if there's some nice access the numpy array provides.

  5. What does the term "Tuple" Mean in Relational Databases?

    Apr 15, 2009 · This answer fails to distinguish the different meanings of the term "tuple" by default in mathematics (ordered) vs in relational database contexts (unordered name-value pair sets).

  6. types - What are "named tuples" in Python? - Stack Overflow

    Jun 4, 2010 · Named tuple instances can be referenced using object-like variable dereferencing or the standard tuple syntax. They can be used similarly to struct or other common record …

  7. python - Add another tuple to a tuple of tuples - Stack Overflow

    "Alternately, consider making my_choices a list-of-tuples", the reason being lists are mutable, contrary to tuples. And if tuples are immutable, it's because this allows more efficient operations.

  8. AttributeError: 'tuple' object has no attribute - Stack Overflow

    Mar 3, 2014 · at the end of the method, Python constructs a tuple with the values of s1, s2, s3 and s4 as its four members at index 0, 1, 2 and 3 - NOT a dictionary of variable names to values, …

  9. What does *tuple and **dict mean in Python? - Stack Overflow

    As mentioned in PythonCookbook, * can be added before a tuple. What does * mean here? Chapter 1.18. Mapping Names to Sequence Elements: from collections import namedtuple …

  10. Using Pairs or 2-tuples in Java - Stack Overflow

    Apr 20, 2010 · Since a tuple is not of a defined length, this solution is equivalent. 3) In your case, you seem to need a Pair (i.e. a tuple of well-defined length 2). This renders maerics's answer …