About 16,100,000 results
Open links in new tab
  1. How does tuple comparison work in Python? - Stack Overflow

    The python 2.5 documentation explains it well. Tuples and lists are compared lexicographically using comparison of corresponding elements. This means that to compare equal, each …

  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. Type hinting tuples in Python - Stack Overflow

    Nov 28, 2017 · I have this use case where a caller supplies one or two item tuples in a list. There can be any number of tuples in the list but all the tuples are either length one or length two. I …

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

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

  6. 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<string, string> methodTuple() { return new …

  7. How can I convert a tuple to a float in python? - Stack Overflow

    Dec 9, 2013 · Say I created a tuple like this using a byte array: import struct a = struct.unpack('f', 'helo') How can I now convert a into a float? Any ideas?

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

  9. Python typing: tuple [str] vs tuple [str, ...] - Stack Overflow

    Apr 25, 2022 · Python typing: tuple [str] vs tuple [str, ...] Asked 3 years, 6 months ago Modified 3 years, 6 months ago Viewed 8k times

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

    Aug 19, 2015 · 3 Boost tuple would be my preferred choice for a generalized system of returning more than one value from a function. Possible example: