class neuron: def __init__(self, num_of_inps): self.weights = [] #randomzie the values of the weights for i in num_of_inps: self.weights.append[random()] def run(self, inputs): #make sure there is one input for each node if len(inputs) != len(self.weights): print "Inputs dont match weights" return None sum = 0 for i,w in zip(inputs, self.weights): sum += i * w return sum