python
juoyi
这个作者很懒,什么都没留下…
展开
-
map函数的用法
map函数在python2和python3中稍有不同,python2直接返回一个列表,python3则返回一个map的可迭代对象一、python2的官方解释:map(...) map(function, sequence[, sequence, ...]) -> list Return a list of the results of applying the fu...原创 2018-04-17 11:30:01 · 16085 阅读 · 0 评论 -
reduce函数的用法
首先看reduce函数的官方解释(python2):reduce(...) reduce(function, sequence[, initial]) -> value Apply a function of two arguments cumulatively to the items of a sequence, from left to right,...原创 2018-04-17 19:43:50 · 8632 阅读 · 0 评论 -
zip函数的用法
下面是python3的解释:class zip(object) | zip(iter1 [,iter2 [...]]) --> zip object | | Return a zip object whose .__next__() method returns a tuple where | the i-th element comes from the i-th i...原创 2018-06-13 17:11:19 · 1895 阅读 · 1 评论