Perceptron Implementation in Python