📅  最后修改于: 2022-03-11 14:47:24.740000             🧑  作者: Mango
# pip install pipe
from pipe import select, where, dedup
arr = [1,2,3,4,5,4,3,2,1,1,1]
res = list(arr
| dedup # remove duplicates -> [1,2,3,4,5]
| where(lambda e: e%2 == 0) # filter for even numbers -> [2,4]
| select(lambda e: e * 2) # double all numbers -> [4,8]
)