Python 特殊語法:filter、map、reduce、lambda

Python內置了一些特殊函數,這些函數很具python特性。可讓代碼更加簡潔。html 能夠看例子:python 1 filter(function, sequence):函數 str = ['a', 'b','c', 'd']post def fun1(s): return s if s != 'a' else Noneui ret = filter(fun1, str)htm print r
相關文章
相關標籤/搜索