About 17,000,000 results
Open links in new tab
  1. 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 …

  2. 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?

  3. Returning multiple values from a C++ function - Stack Overflow

    Aug 19, 2015 · F.21: To return multiple “out” values, prefer returning a struct or tuple Reason A return value is self-documenting as an “output-only” value. Note that C++ does have multiple …

  4. Python type hints for function returning multiple return values

    Sep 25, 2019 · Actually, a Python function never returns "multiple values". What you are returning here is a tuple.

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

  6. 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.

  7. c# - Tuple.Create () vs new Tuple - Stack Overflow

    Dec 13, 2014 · Consider the following expressions: new Tuple<int,int>(1,2); Tuple.Create(1,2); Is there any difference between these two methods of Tuple creation? From my reading it seems …

  8. c# - How to name tuple properties? - Stack Overflow

    How and "could be" organized return from the method which returns tuple type with the name of parameters, as an example private static Tuple&lt;string, string&gt; methodTuple() { return new …

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

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

    Jun 25, 2013 · 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 …