You are viewing a single comment's thread from:

RE: 每天进步一点点:Python中使用函数作为参数

in #python6 years ago (edited)

可能是玩functional太多了,当我写java和python都会用Lambda

Python 3

def increase (n): return lambda x: x + n
vals = increase([1])
print(vals(2))

然后在lambda都能用filter,map和reduce

Coin Marketplace

STEEM 0.17
TRX 0.14
JST 0.028
BTC 58607.22
ETH 2616.94
USDT 1.00
SBD 2.43