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.09
TRX 0.30
JST 0.037
BTC 103405.90
ETH 3487.22
USDT 1.00
SBD 0.56