You are viewing a single comment's thread from:

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

in #python8 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.04
TRX 0.32
JST 0.078
BTC 63502.24
ETH 1662.81
USDT 1.00
SBD 0.41