python reduce()

 

 

from functools import reduce

list_x = ['1','2','3','4','5']

r= reduce(lambda x,y:x+y,list_x,'aaa')
print r

--aaa12345

 

posted @ 2019-10-22 21:59  AngDH  阅读(104)  评论(0编辑  收藏  举报