@fgwww 我现在就给你手写一个 sort = lambda l: sort(l[:len(l)/2])+l[len(l)/2]+sort(l[len(l)/2+1:]) if l else []
wenbinwu
2014-09-23 15:33:48 +08:00
@binux >>> sort = lambda l: sort(l[:len(l)/2])+l[len(l)/2]+sort(l[len(l)/2+1:]) if l else [] >>> sort([2,1,4]) Traceback (most recent call last): File "<console>", line 1, in <module> File "<console>", line 1, in <lambda> File "<console>", line 1, in <lambda> TypeError: can only concatenate list (not "int") to list