1
Pythagodzilla 2016 年 11 月 10 日
print result*reduce(operator.mul, [3,2,5])
这样? |
2
littleshy 2016 年 11 月 10 日 reduce(operator.ixor,[3,2,5])
|
3
woostundy 2016 年 11 月 10 日
l = [3,2,5]
reduce(lambda x,y:x^y,l) |
4
woostundy 2016 年 11 月 10 日
好尴尬,刚发出来刷新发现上面有更好的写法
|
5
zungmou OP |
7
Herobs 2016 年 11 月 10 日 via Android
reduce 或者递归
|
8
Pythagodzilla 2016 年 11 月 10 日
@zungmou 惊了,没仔细看发现写的是*...2L 是对的...
|
9
staticor 2016 年 11 月 10 日
顺便可以了解一些函数式编程的内容
|
11
Zuckonit 2016 年 11 月 10 日
reduce
|