Get the App
SLTechnology News&Howtos  ›  Development  › 

How python uses Lambda with map functionality

Shulou Source: shulou.com Published: 2022-06-01 04:44:00 09月22日 Update

Editor to share with you how python uses Lambda and map functions. I hope you will get something after reading this article. Let's discuss it together.

Use Lambda with the map feature

This function can be replaced with the lambda function in python. Create the following program to create the square of the list of numbers.

My_list = [1,2,3,4,5] new_list = map (lambda x: Xerox, my_list) print (list (new_list))

Output quantity

[1, 4, 9, 16, 25] after reading this article, I believe you have a certain understanding of "how python uses Lambda with map functions". If you want to know more about it, please follow the industry information channel. Thank you for reading!

Tags: Functions functions articles done numbers more knowledge programs industry information information channels channels output Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology macOS Redmi Xiaomi MySQL