Advance(8/8) reduce

reduce() : 畳み込み、関数型言語、高階関数
   from fanctiontools import reduce #python3以降
reduce ( 関数 , イテオブ {{ ,initializer }} )

 from functiontools import reduce
 from operater import add
 from operater import mul
 lst_1 = [ 10 , 1 , 2 , 3 , 4 ]
 print ( reduce( add , lst_1 ) )
 # 20
 print ( reduce( mul , lst_1) )
 # 240
 

※ add のとき 10+1+2+3+4=20
※ mulのとき 10x1x2x3x4 = 240