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

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

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

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

  10. python - Inserting an item in a Tuple - Stack Overflow

    Jan 3, 2017 · Welcome to functional programming. You're not updating a tuple, you're creating a new tuple from an old tuple. Use collections.namedtuple and it will be obvious that your're …