import math


def shannon_entropy_probability_list(list):
    """
    Calculates the Shannon entropy for the given probability distribution.
    :param list: A list that contaion proablity distrubutin .
    :type list: str
    :returns: Shannon entropy for the given probability distribution.
    :rtype: float
    """
    ent=0.0
    for prob in list:
        if (prob<0 or prob > 1):
            if(prob<0):
               raise Exception("Probability cannot be negative.Check the value",prob)
            else:
             raise Exception("Probability cannot be greater than one.Check the value",prob)   
        ent=ent+prob * (math.log((1/prob),2))
    return ent