def update_weights(net, inp, alpha):
    for i in range(len(net)):
        if (i == 0):
            inputs = inp
        else:
            inputs = []
            prev_layer = net[(i - 1)]
            for neuron in prev_layer:
                inputs.append(neuron.output)
        curr_layer = net[i]
        for neuron in curr_layer:
            for j in range(len(inputs)):
                neuron.weights[j] += ((alpha * neuron.delta) * inputs[j])
            neuron.weights[(- 1)] += (alpha * neuron.delta)
def update_weights(net, inp, alpha):
    for i in range(len(net)):
        if (i == 0):
            inputs = inp
        else:
            inputs = []
            prev_layer = net[(i - 1)]
            for neuron in prev_layer:
                inputs.append(neuron.output)
        curr_layer = net[i]
        for neuron in curr_layer:
            for j in range(len(inputs)):
                neuron.weights[j] += ((alpha * neuron.delta) * inputs[j])
            neuron.weights[(- 1)] += (alpha * neuron.delta)