Lecture 7: Perceptron python implementation