def randomMultinomial(dist):
    """
    @param dist: List of positive numbers summing to 1 representing a
    multinomial distribution over integers from 0 to C{len(dist)-1}.
    @returns: random draw from that distribution
    """
    r = random.random()
    for i in range(len(dist)):
        r = r - dist[i]
        if 0.0 < r:
            return i
    return "weird"
dataset/ETHPy150Open rll/lfd/lfd/rapprentice/util.py/randomMultinomial/swapped operands of `<`