Use of Python-filter and map

1.filter (arg1, arg2)

The first parameter is None or a function object, the second is a summary of iterable data
Insert picture description here
Insert picture description here
: if the first parameter is None, then the corresponding value in the second parameter is filtered out, if it is a function, then the function returns Take out the true value

2.map(arg1,arg2)

arg1 is the function, arg2 is the iterable data

Insert picture description here
Summary: return a data set consisting of function return values

Published 28 original articles · praised 0 · visits 619

Guess you like

Origin blog.csdn.net/qq_44932835/article/details/105475448