reduce map filter 三种函数的详细用法

from functools import reduce
sentences = ['The Deep Learning textbook is a resource intended to help students and practitioners enter the field of machine learning in general and deep learning in particular. '] 
word_count =reduce(lambda a,x:a+x.count("learning"),sentences,0)
print(word_count)

 

 
posted @ 2018-08-08 22:06  本本蜀黍  阅读(171)  评论(0编辑  收藏  举报