About 36,500,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. How does tuple comparison work in Python? - Stack Overflow

    Feb 13, 2017 · 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 …

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

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

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

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

  7. python中的tuple应该怎么读? - 知乎

    Oct 31, 2014 · 北鸷煸甘南 一脸严肃的女孩子,老婆是@南鸢炖萝北 3 人赞同了该回答 tuple的词源: 五元组 quintuple [ˈkwɪntjʊpl] 六元组 sextuple ['sekstjʊpl] 七元组 septuple ['septjʊpl] 八元 …

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

  9. What's the difference between System.ValueTuple and …

    Dec 14, 2017 · 39 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# …

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