def __setitem__(self, val, p):
        "Set P(val) = p."
        if val not in self.values:
            self.values.append(val)
        self.prob[val] = p
def __setitem__ ( self , val , p ) : if val not in self . values : self . values . append ( val ) self . prob [ val ] = p
Set P(val) = p.