About 18,800,000 results
Open links in new tab
  1. 如何理解和使用tuple? - 知乎

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

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

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

    Oct 31, 2014 · python中的tuple应该怎么读? 有道词典是这样说的: 英 ['tjuːp (ə)l] 美 ['tjup (ə)l] 百度是这样说的: [英]tʌpl [美]tʌpl 书上是这样说的: 发音… 显示全部 关注者 26

  6. python - Convert numpy array to tuple - Stack Overflow

    Apr 5, 2012 · Is there an easy way to convert that to a tuple? I know that I could just loop through, creating a new tuple, but would prefer if there's some nice access the numpy array provides.

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

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

  10. How can you iterate over the elements of an std::tuple?

    Feb 8, 2019 · If you want to use std::tuple and you have C++ compiler which supports variadic templates, try code bellow (tested with g++4.5). This should be the answer to your question.