V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  jazoma  ›  全部回复第 1 页 / 共 1 页
回复总数  3
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   ·   实用小工具   ·   1392 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 17:21 · PVG 01:21 · LAX 10:21 · JFK 13:21
Developed with CodeLauncher
♥ Do have faith in what you're doing.