def normListSumTo(L, sumTo=1):
    '''normalize values of a list to make it sum = sumTo'''

    sum = reduce(lambda x,y:x+y, L)
    return [ x/(sum*1.0)*sumTo for x in L]
normalize values of a list to make it sum = sumTo
recipes/Python/278258_List_Tools/recipe-278258.py