码迷,mamicode.com
首页 >  
搜索关键字:tuples    ( 155个结果
lists,tuples and sets of Python
Lists 列表 列表是一个有序序列(集合),可以理解为其他语言中的数组类型,但是列表更灵活更强大。 列表由方括号[]来定义的,它的元素可以是任意类型或对象,一个列表中可以包含混合元素。 例: x = [] 创建空...
分类:编程语言   时间:2014-12-10 12:20:51    阅读次数:220
探索Scala(6)-- Tuples
本文讨论一下Tuple的用法和实现方式...
分类:其他好文   时间:2014-10-31 17:30:34    阅读次数:184
Most common words
To find the most common words, we can apply the DSU pattern; most_common takes a histogram and returns a list of word-frequency tuples, sorted in reve...
分类:其他好文   时间:2014-08-17 17:00:32    阅读次数:180
Sequences of sequences
I have focused on lists of tuples, but almost all the examples in this chapter also work with lists of lists, tuples of tuples, and tuples of lists. T...
分类:其他好文   时间:2014-07-24 22:44:03    阅读次数:207
Lists and tuples
zip is a built-in function that takes two or more sequence and ‘zips’ them into a list of tuples, where each tuple contains one element from each sequ...
分类:其他好文   时间:2014-07-22 22:53:14    阅读次数:269
Dictionaries and tuples
Dictionaries have a method called items that returns a list of tuples, where each tuple is a key-value pair. As you should expect from a dictionary, t...
分类:其他好文   时间:2014-07-19 23:02:40    阅读次数:372
Tuples as return values
Strictly speaking, a function can only return one value, but if the value is a tuple, the effect is the same as returning multiple values. For example...
分类:其他好文   时间:2014-07-19 18:31:23    阅读次数:208
Tuples are immutable
A tuple is a sequence of values. The values can be any type, and they are indexed by integers, so in that respect tuples are a lot like lists. The imp...
分类:其他好文   时间:2014-07-16 18:17:44    阅读次数:213
swift-元组
元组(tuples)把多个值组合成一个复合值。元组内的值可以使任意类型,并不要求是相同类型。你可以把任意顺序的类型组合成一个元组,这个元组可以包含所有类型。只要你想,你可以创建一个类型为(Int, Int, Int)或者(String, Bool)或者其他任何你想要的组合的元组。 元祖定义 let name = ("jin","chen") 元祖读取 let (givenName,...
分类:其他好文   时间:2014-07-15 10:21:02    阅读次数:206
Swift学习——Swift基础详解(五)
上回书说道:灰常灰常基本的数据类型 下面咱们来点高级的: Tuples    元组 元组存储一对键值,并且没有类型限制 let http404Error = (404, "Not Found") // http404Error is of type (Int, String), and equals (404, "Not Found")书上废话一堆,反正元组就是这么写,上面的例子还...
分类:其他好文   时间:2014-07-01 06:55:09    阅读次数:236
155条   上一页 1 ... 13 14 15 16 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!