jazoma 最近的时间轴更新
jazoma

jazoma

V2EX 第 301031 号会员,加入于 2018-03-17 23:00:20 +08:00
jazoma 最近回复了
2018-05-01 08:54:43 +08:00
回复了 enm 创建的主题 程序员 想写一个更高智商的编程语言
这样的语言早就有了,而且有很多,它们都合起来就叫"面向员工编程语言", 使用这门语言的程序员叫老板。
2018-03-18 11:53:03 +08:00
回复了 koplyp 创建的主题 Python 求助各位大神, 如何将(a,(b,(c,(d,(e,(f))))))转换为(f,(e,(d,(c,(b,(a))))))
-from functools import reduce
-
-def f(ys,s=[]):
-----x,xs = ys
-----if type(xs) != tuple:
---------return reduce(lambda x,y: (y,(x)), s+[x,xs])
-----return f(xs,s+[x])
2018-03-18 11:47:57 +08:00
回复了 koplyp 创建的主题 Python 求助各位大神, 如何将(a,(b,(c,(d,(e,(f))))))转换为(f,(e,(d,(c,(b,(a))))))
from functools import reduce

def f(ys,s=[]):
x,xs = ys
if type(xs) != tuple:
return reduce(lambda x,y: (y,(x)), s+[x,xs])
return f(xs,s+[x])
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1454 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 17:11 · PVG 01:11 · LAX 10:11 · JFK 13:11
Developed with CodeLauncher
♥ Do have faith in what you're doing.