42. 람다와 map·filter·sorted의 key
다음 Python 프로그램의 실행 결과를 쓰시오.
1words = ["plum", "fig", "banana", "kiwi", "mini"]2lens = list(map(lambda w: len(w), words))3print(lens)4short = list(filter(lambda w: len(w) <= 4, words))5print(short)6by_len = sorted(words, key=len, reverse=True)7print(by_len)8by_key = sorted(words, key=lambda w: (len(w), w[-1]))9print(by_key)10f = lambda x, y=3: x * y + 111print(f(2), f(2, 5))12nums = [5, 2, 8, 1]13total = 014for v in map(lambda n: n * n, nums):15if v % 2 == 0:16total += v17print(total)18print(sorted(nums)[-2], nums)