About 15,600,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 · 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 …

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

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

  5. 如何理解和使用tuple? - 知乎

    tuple一般在中文中称为元组,或者说n元组。就是由n个元素组成的一种有序数据结构(当然n是不小于零的整数)。不同的编程语言对元组有不同实现,但既然标签打的Python,那就只谈 …

  6. Type hinting tuples in Python - Stack Overflow

    Nov 28, 2017 · Just a note: if you need a tuple containing a variable number, you should think whether you should use a list instead. Maybe a tuple is still the right choice, but usually a list …

  7. c++ - Detect if a type is a std::tuple? - Stack Overflow

    In normal time this could be dangerous and a specialization would be preferable. But this function is a large function, and only a small if inside change whether tuple type or not.

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

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

    You can write i = 5 + tup()[0] Tuples can be indexed just like lists. The main difference between tuples and lists is that tuples are immutable - you can't set the elements of a tuple to different …

  10. How to create tuple with a loop in python - Stack Overflow

    Feb 17, 2018 · 3 A tuple is an immutable list. This means that, once you create a tuple, it cannot be modified. Read more about tuples and other sequential data types here.