Simple Python implementation of a Learning Agent