Python-lambda函數,map函數,filter函數

來源:互聯網
上載者:User

標籤:art   put   bsp   依次   list   html   否則   cti   理解   

lambda函數主要理解:

    lambda 參數:操作(參數)。 lambda語句中,冒號前是參數,可以有多個,用逗號隔開,冒號右邊的傳回值。lambda語句構建的其實是一個函數對象

map函數:

   map(function_to_apply, list_of_inputs)。map函數可以把list_of_inputs內的對象依次輸入到function_to_apply中進行操作。

filter函數:

  filter(function_to_apply, list_of_inputs)。Filter函數就是把list_of_inputs內的每個對象依次輸入到function_to_apply中,當function_to_apply的的傳回值是True的時候,這個參數就保留,

                                                                  否則就丟棄。

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

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

[3]. python 進階

Python-lambda函數,map函數,filter函數

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.