2014年7月11日金曜日

python: lambda

my_list=range(10)
print filter(lambda x:x%2==0,my_list)

[0, 2, 4, 6, 8]

0 件のコメント:

コメントを投稿