from functools import reduce
from operator import add

def average(gens):
    tailles = list(
                map( lambda x: x['taille'] ,
                    filter(
                        lambda x: 'taille' in x , gens
                    )
                )
            )

    if len(tailles) > 0:
        return reduce(add , tailles) / len(tailles)

gens = [
        {'nom': 'Pierre' , 'taille': 178},
        {'name': 'Marie' , 'taille': 181},
        {'name': 'Paul'  , 'taille': 157}
       ]

print( average(gens) )
