About 69,400,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. 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 …

  4. 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. …

  5. 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 = …

  6. python - Convert tuple to list and back - Stack Overflow

    Apr 30, 2013 · Both the answers are good, but a little advice: Tuples are immutable, which implies that they cannot be changed. So if you need to manipulate data, it is better to store data in a list, it will …

  7. python - Inserting an item in a Tuple - Stack Overflow

    Jan 3, 2017 · Yes, I understand tuples are immutable but the situation is such that I need to insert an extra value into each tuple. So one of the items is the amount, I need to add a new item next to it in a

  8. python - How are tuples unpacked in for loops? - Stack Overflow

    Short answer, unpacking tuples from a list in a for loop works. enumerate () creates a tuple using the current index and the entire current item, such as (0, ('bob', 3))

  9. What's the difference between System.ValueTuple and System.Tuple?

    40 The difference between Tuple and ValueTuple is that Tuple is a reference type and ValueTuple is a value type. The latter is desirable because changes to the language in C# 7 have tuples being used …

  10. Convert list to tuple in Python - Stack Overflow

    Have you assigned the name 'tuple' as a variable name? it should work fine. L is a list and we want to convert it to a tuple. L = [1, 2, 3] tuple (L) By invoking tuple, you convert the list (L) into a tuple. As …