The Perceptron Algorithm explained with Python code