|
>>> get = lambda i,m: m if not i else get(i[1:], m[i[0]])
>>> matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
>>> idx = (1,2)
>>> get(idx, matrix)
6
>>> def hap(x, y):
... return x + y
...
>>> hap(10, 20)
30
>>> (lambda x,y: x + y)(10, 20)
30
>>> map(lambda x: x ** 2, range(5)) # ÆÄÀ̽ã 2
[0, 1, 4, 9, 16]
>>> list(map(lambda x: x ** 2, range(5))) # ÆÄÀ̽ã 2 ¹× ÆÄÀ̽ã 3
[0, 1, 4, 9, 16]
|
|