@ Introducing Python: Modern Computing in Simple Packages by Bill Lubanovic (No. 2736 / 12833)
There is a description about lambda.
The following two usages
I tried the tiny function.
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])
result
9fo7
yawenaJ
ablE was I ere I saw elbA
Recommended Posts