About 54 results
Open links in new tab
  1. 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.

  2. list - What exactly are tuples in Python? - Stack Overflow

    A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists. The differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples use parentheses, …

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

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

    tuple的词源: 五元组 quintuple [ˈkwɪntjʊpl] 六元组 sextuple ['sekstjʊpl] 七元组 septuple ['septjʊpl] 八元组 octuple ['ɒktjʊpl] 显然 ['tjʊpl]无疑。

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

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

  8. python - How to change values in a tuple? - Stack Overflow

    4 You can't modify items in tuple, but you can modify properties of mutable objects in tuples (for example if those objects are lists or actual class objects) For example

  9. python - Getting one value from a tuple - Stack Overflow

    The main difference between tuples and lists is that tuples are immutable - you can't set the elements of a tuple to different values, or add or remove elements like you can from a list.

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

    Apr 30, 2013 · if you have a tuple just iterate until you have the elements there are necessary and after that append to a list. And if you go to the element level you can change it easily.