About 39,800,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 · A tuple is a good way to pack multiple values into that cookie without having to define a separate class to contain them. I try to be judicious about this particular use, though.

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

    Jun 4, 2010 · Named tuples are basically easy-to-create, lightweight object types. Named tuple instances can be referenced using object-like variable dereferencing or the standard tuple syntax. …

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

    Apr 5, 2012 · Note: This is asking for the reverse of the usual tuple-to-array conversion. I have to pass an argument to a (wrapped c++) function as a nested tuple. For example, the following works X = …

  5. 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 second) then that's …

  6. How to create tuple with a loop in python - Stack Overflow

    Feb 17, 2018 · 3 A tuple is an immutable list. This means that, once you create a tuple, it cannot be modified. Read more about tuples and other sequential data types here.

  7. pop/remove items out of a python tuple - Stack Overflow

    However, assuming the OP requires a tuple for output, the difference comes in the conversion back. For proof: take tuple () off the generator and they'll both return instantly, but tuple () the filter and it takes …

  8. IndexError: tuple index out of range ----- Python - Stack Overflow

    Nov 30, 2013 · tuple are index based (and also immutable) in Python. Here in this case x = rows[1][1] + " " + rows[1][2] have only two index 0, 1 available but you are trying to access the 3rd index.

  9. 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).

  10. python - List vs tuple, when to use each? - Stack Overflow

    Using a tuple instead of a list is like having an implied assert statement that this data is constant, and that special thought (and a specific function) is required to override that. Some tuples can be used as …