Python Code -Why is the class probality coming out as 0 when within te for loop its being calculated correctly : Python code snipper

I have isolated the bug in
    def classify_single_elem(self, X_elem):
        Y_dict = {}
    #   print ('self.label' ,self.labels)      ok
        for label in self.labels:
            class_probability = self.class_probabilities[label]
    #        print ('class probability' ,class_probability)   okok
            for ii in range(0,len(X_elem)):
                relative_feature_values = self.nb_dict[label][ii]
                if X_elem[ii] in relative_feature_values.keys():
                    class_probability *= relative_feature_values[X_elem[ii]]    ok
                else:
                    class_probability *= 0   
                                when it gets to here the probability is set to zero which means the dict has zero values
            Y_dict[label] = class_probability  
        return self.get_max_value_key(Y_dict)