A simple Python-based perceptron implementation