Lists and tuples are similar, but whereas a tuple can only be used in a comparison, lists allow a wider variety of manipulation operations to be performed.
列表与元组相似,但是元组只能在比较中使用,而列表允许执行的操作更多。
Of course, few Python programmers want to work with increasingly complex forests of data structures like the lists, tuples, and dictionaries above.
当然,很少有Python程序员希望使用上面的诸如列表、元组和字典等日益复杂的数据结构。
No specialized Python classes are used in the representation — just tuples, dicts, lists, and strings (and None in the reserved position).
表示中没有使用专门的python类——只使用了元组、字典、列表和字符串(以及保留位置上的None)。
In contrast to lists, tuples, and dictionaries, which may contain heterogeneous elements, Numarray arrays contain only elements of a homogeneous data type.
与可以包含不同类型元素的列表、元组和词典不同的是,Numarray数组只能包含同一类型的数据。
Tuples contain primitive elements of mixed types and can even contain other tuples or lists.
tuple包含固定类型的原语元素,甚至可以包含其他 tuple或列表。
The three most prominent data structures in Haskell are tuples, lists, and user-defined types.
Haskell中最突出的三种数据结构是:tuple、列表(list)和用户定义的类型。
This chapter presents one more built-in type, the tuple, and then shows how lists, dictionaries, and tuples work together.
本章我们要说的是另外一种内置类型,元组,以及列表、字典和元组如何协同工作。
I have focused on lists of tuples, but almost all of the examples in this chapter also work with lists of lists, tuples of tuples, and tuples of lists.
之前我一直在讲由元组组成的列表,但本章几乎所有的例子也适用于由列表组成的列表、元组组成的元组以及列表组成的元组。
In many contexts, the different kinds of sequences (strings, lists and tuples) can be used interchangeably. So how should you choose one over the others?
很多情况下,不同种类的序列(字符串、列表和元组)是可以交换使用的。那么该如何选择用哪种序列呢?
Lists are more common than tuples, mostly because they are mutable. But there are a few cases where you might prefer tuples.
列表用的要比元组更广泛,主要因为列表可以修改。但以下这些情况下,你还是用元组更好。
We have seen methods for strings, lists, dictionaries and tuples.
之前我们看到过字符串、列表、字典以及元组的一些方法。
To that end, you are encouraged to try to think of matrices as lists of tuples, or perhaps better as "tuples of tuples, " whose order has some deeper meaning than "that's just the way it works.
可以理解矩阵是元组的列表,元组的元组,他的排序意味着:“这就是他的工作方式。”
To that end, you are encouraged to try to think of matrices as lists of tuples, or perhaps better as "tuples of tuples, " whose order has some deeper meaning than "that's just the way it works.
可以理解矩阵是元组的列表,元组的元组,他的排序意味着:“这就是他的工作方式。”
应用推荐