python:map

一map 會根據提供的函數對指定序列做映射 語法: map(function,iterable,…) 參數說明: function:函數 iterable:一個或者多個序列 返回值: py2返回列表 py3 返回可迭代對象 舉例: >>> def square(x): ...     return x**2 ... >>> map(square,[1,2,3,4,5])         <map
相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息