from functools import reduce
def pipeline_each(liste , fonctions):
return reduce(
lambda a , x: map(x , a) , fonctions ,liste )
def format1(chaine):
return chaine.title()
def format2(chaine):
return chaine.replace('.' , ';')
print( list( pipeline_each(
[ 'Le monde est à nous.' ,
' Il ne faut pas le détériorer.' ] ,
[format2,format1] ) ) )