PYTHON-LAMBDA function, map function, filter function

Source: Internet
Author: User

The lambda function mainly understands:

Lambda parameter: Action (parameter). In a lambda statement, the colon is preceded by a parameter, which can have multiple, separated by commas, and a return value to the right of the colon. A lambda statement is actually built as a function object

Map function:

Map (function_to_apply, list_of_inputs). The map function can then enter the objects in the list_of_inputs into the function_to_apply in sequence.

Filter function:

Filter (function_to_apply, list_of_inputs). The filter function is to enter each object in the list_of_inputs into Function_to_apply, and when the return value of Function_to_apply is true, this parameter is preserved.

Otherwise, discard.

[1]. http://www.cnblogs.com/BeginMan/p/3178103.html

[2]. http://www.jb51.net/article/64999.htm

[3]. Python Advanced

PYTHON-LAMBDA function, map function, filter function

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.