@ Introducing Python: Modern Computing in Simple Packages by Bill Lubanovic (No. 2736 / 12833)
Il y a une description de lambda.
Les deux usages suivants
J'ai essayé la fonction minuscule.
http://ideone.com/jKrTOy
def print_processed(alist, func):
for elem in alist:
print(func(elem))
members = [ '7of9', 'Janeway', 'Able was I ere I saw Elba' ]
print_processed(members, lambda word: word[::-1])
résultat
9fo7
yawenaJ
ablE was I ere I saw elbA
Recommended Posts